// EnergyPlus, Copyright (c) 1996-2025, The Board of Trustees of the University of Illinois,
// The Regents of the University of California, through Lawrence Berkeley National Laboratory
// (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
// National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
// contributors. All rights reserved.
//
// NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
// U.S. Government consequently retains certain rights. As such, the U.S. Government has been
// granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
// worldwide license in the Software to reproduce, distribute copies to the public, prepare
// derivative works, and perform publicly and display publicly, and to permit others to do so.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted
// provided that the following conditions are met:
//
// (1) Redistributions of source code must retain the above copyright notice, this list of
//     conditions and the following disclaimer.
//
// (2) Redistributions in binary form must reproduce the above copyright notice, this list of
//     conditions and the following disclaimer in the documentation and/or other materials
//     provided with the distribution.
//
// (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
//     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
//     used to endorse or promote products derived from this software without specific prior
//     written permission.
//
// (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
//     without changes from the version obtained under this License, or (ii) Licensee makes a
//     reference solely to the software portion of its product, Licensee must refer to the
//     software as "EnergyPlus version X" software, where "X" is the version number Licensee
//     obtained under this License and may not use a different name for the software. Except as
//     specifically required in this Section (4), Licensee shall not use in a company name, a
//     product name, in advertising, publicity, or other promotional activities any name, trade
//     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
//     similar designation, without the U.S. Department of Energy's prior written consent.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

// EnergyPlus::AirflowNetwork unit tests related to conditions and environment

// Google test headers
#include <gtest/gtest.h>

// EnergyPlus Headers
#include <AirflowNetwork/Elements.hpp>
#include <AirflowNetwork/Solver.hpp>
#include <EnergyPlus/CurveManager.hh>
#include <EnergyPlus/Data/EnergyPlusData.hh>
#include <EnergyPlus/DataEnvironment.hh>
#include <EnergyPlus/DataHVACGlobals.hh>
#include <EnergyPlus/DataHeatBalance.hh>
#include <EnergyPlus/DataLoopNode.hh>
#include <EnergyPlus/DataSurfaces.hh>
#include <EnergyPlus/HeatBalanceManager.hh>
#include <EnergyPlus/IOFiles.hh>
#include <EnergyPlus/Material.hh>
#include <EnergyPlus/OutAirNodeManager.hh>
#include <EnergyPlus/ScheduleManager.hh>
#include <EnergyPlus/SimulationManager.hh>
#include <EnergyPlus/SurfaceGeometry.hh>
#include <EnergyPlus/ZoneTempPredictorCorrector.hh>

#include "Fixtures/EnergyPlusFixture.hh"

using namespace EnergyPlus;
using namespace AirflowNetwork;
using namespace DataSurfaces;
using namespace DataHeatBalance;
using namespace EnergyPlus::DataLoopNode;

namespace EnergyPlus {

TEST_F(EnergyPlusFixture, AirflowNetwork_TestDefaultBehaviourOfSimulationControl)
{

    // Unit test for #5021

    state->dataHeatBal->Zone.allocate(1);
    state->dataHeatBal->Zone(1).Name = "SALA DE AULA";

    state->dataSurface->Surface.allocate(2);
    state->dataSurface->Surface(1).Name = "WINDOW AULA 1";
    state->dataSurface->Surface(1).Zone = 1;
    state->dataSurface->Surface(1).ZoneName = "SALA DE AULA";
    state->dataSurface->Surface(1).Azimuth = 0.0;
    state->dataSurface->Surface(1).ExtBoundCond = 0;
    state->dataSurface->Surface(1).HeatTransSurf = true;
    state->dataSurface->Surface(1).Tilt = 90.0;
    state->dataSurface->Surface(1).Sides = 4;
    state->dataSurface->Surface(2).Name = "WINDOW AULA 2";
    state->dataSurface->Surface(2).Zone = 1;
    state->dataSurface->Surface(2).ZoneName = "SALA DE AULA";
    state->dataSurface->Surface(2).Azimuth = 180.0;
    state->dataSurface->Surface(2).ExtBoundCond = 0;
    state->dataSurface->Surface(2).HeatTransSurf = true;
    state->dataSurface->Surface(2).Tilt = 90.0;
    state->dataSurface->Surface(2).Sides = 4;

    SurfaceGeometry::AllocateSurfaceWindows(*state, 2);
    state->dataSurface->Surface(1).OriginalClass = DataSurfaces::SurfaceClass::Window;
    state->dataSurface->Surface(2).OriginalClass = DataSurfaces::SurfaceClass::Window;
    state->dataGlobal->NumOfZones = 1;

    std::string const idf_objects = delimited_string({
        "Schedule:Constant,OnSch,,1.0;",
        "Schedule:Constant,Aula people sched,,0.0;",
        "Schedule:Constant,Sempre 21,,21.0;",
        "AirflowNetwork:MultiZone:Zone,",
        "  sala de aula, !- Zone Name",
        "  Temperature, !- Ventilation Control Mode",
        "  Sempre 21, !- Ventilation Control Zone Temperature Setpoint Schedule Name",
        "  1, !- Minimum Venting Open Factor{ dimensionless }",
        "  , !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor{ deltaC }",
        "  100, !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor{ deltaC }",
        "  , !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor{ deltaJ / kg }",
        "  300000, !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor{ deltaJ / kg }",
        "  Aula people sched, !- Venting Availability Schedule Name",
        "  Standard;                !- Single Sided Wind Pressure Coefficient Algorithm",
        "AirflowNetwork:MultiZone:Surface,",
        "  window aula 1, !- Surface Name",
        "  Simple Window, !- Leakage Component Name",
        "  , !- External Node Name",
        "  1, !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
        "  ZoneLevel, !- Ventilation Control Mode",
        "  , !- Ventilation Control Zone Temperature Setpoint Schedule Name",
        "  , !- Minimum Venting Open Factor{ dimensionless }",
        "  , !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor{ deltaC }",
        "  100, !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor{ deltaC }",
        "  , !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor{ deltaJ / kg }",
        "  300000, !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor{ deltaJ / kg }",
        "  Aula people sched;       !- Venting Availability Schedule Name",
        "AirflowNetwork:MultiZone:Surface,",
        "  window aula 2, !- Surface Name",
        "  Simple Window, !- Leakage Component Name",
        "  , !- External Node Name",
        "  1, !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
        "  Temperature, !- Ventilation Control Mode",
        "  Sempre 21, !- Ventilation Control Zone Temperature Setpoint Schedule Name",
        "  1, !- Minimum Venting Open Factor{ dimensionless }",
        "  , !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor{ deltaC }",
        "  100, !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor{ deltaC }",
        "  , !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor{ deltaJ / kg }",
        "  300000, !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor{ deltaJ / kg }",
        "  Aula people sched;       !- Venting Availability Schedule Name",
        "AirflowNetwork:MultiZone:Component:SimpleOpening,",
        "  Simple Window, !- Name",
        "  0.0010, !- Air Mass Flow Coefficient When Opening is Closed{ kg / s - m }",
        "  0.65, !- Air Mass Flow Exponent When Opening is Closed{ dimensionless }",
        "  0.01, !- Minimum Density Difference for Two - Way Flow{ kg / m3 }",
        "  0.78;                    !- Discharge Coefficient{ dimensionless }",
    });

    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);
    state->afn->get_input();

    // MultizoneZoneData has only 1 element so may be hardcoded
    EXPECT_TRUE(state->afn->control_defaulted);

    EXPECT_EQ(state->afn->simulation_control.name, "AFNDefaultControl");
    EXPECT_ENUM_EQ(AirflowNetwork::ControlType::MultizoneWithoutDistribution, state->afn->simulation_control.type);
    EXPECT_EQ(state->afn->simulation_control.WPCCntr, "SURFACEAVERAGECALCULATION");
    EXPECT_EQ(state->afn->simulation_control.HeightOption, "OPENINGHEIGHT");
    EXPECT_EQ(state->afn->simulation_control.BldgType, "LOWRISE");
    EXPECT_EQ(state->afn->simulation_control.InitType, "ZERONODEPRESSURES");
    EXPECT_FALSE(state->afn->simulation_control.temperature_height_dependence);
    EXPECT_ENUM_EQ(AirflowNetwork::SimulationControl::Solver::SkylineLU, state->afn->simulation_control.solver);
    //// Use default values for numerical fields
    EXPECT_EQ(state->afn->simulation_control.maximum_iterations, 500);
    EXPECT_NEAR(state->afn->simulation_control.relative_convergence_tolerance, 1.0E-4, 0.00001);
    EXPECT_NEAR(state->afn->simulation_control.absolute_convergence_tolerance, 1.E-6, 0.0000001);
    EXPECT_NEAR(state->afn->simulation_control.convergence_acceleration_limit, -0.5, 0.01);
    EXPECT_NEAR(state->afn->simulation_control.azimuth, 0.0, 0.0001);
    EXPECT_NEAR(state->afn->simulation_control.aspect_ratio, 1.0, 0.0001);
}

TEST_F(EnergyPlusFixture, AirflowNetworkSimulationControl_DefaultSolver)
{

    state->dataHeatBal->Zone.allocate(1);
    state->dataHeatBal->Zone(1).Name = "SOFF";

    state->dataSurface->Surface.allocate(2);
    state->dataSurface->Surface(1).Name = "WINDOW 1";
    state->dataSurface->Surface(1).Zone = 1;
    state->dataSurface->Surface(1).ZoneName = "SOFF";
    state->dataSurface->Surface(1).Azimuth = 0.0;
    state->dataSurface->Surface(1).ExtBoundCond = 0;
    state->dataSurface->Surface(1).HeatTransSurf = true;
    state->dataSurface->Surface(1).Tilt = 90.0;
    state->dataSurface->Surface(1).Sides = 4;
    state->dataSurface->Surface(2).Name = "WINDOW 2";
    state->dataSurface->Surface(2).Zone = 1;
    state->dataSurface->Surface(2).ZoneName = "SOFF";
    state->dataSurface->Surface(2).Azimuth = 180.0;
    state->dataSurface->Surface(2).ExtBoundCond = 0;
    state->dataSurface->Surface(2).HeatTransSurf = true;
    state->dataSurface->Surface(2).Tilt = 90.0;
    state->dataSurface->Surface(2).Sides = 4;

    SurfaceGeometry::AllocateSurfaceWindows(*state, 2);
    state->dataSurface->Surface(1).OriginalClass = DataSurfaces::SurfaceClass::Window;
    state->dataSurface->Surface(2).OriginalClass = DataSurfaces::SurfaceClass::Window;
    state->dataGlobal->NumOfZones = 1;

    state->dataHeatBal->TotPeople = 1; // Total number of people statements
    state->dataHeatBal->People.allocate(state->dataHeatBal->TotPeople);
    state->dataHeatBal->People(1).ZonePtr = 1;
    state->dataHeatBal->People(1).NumberOfPeople = 100.0;
    state->dataHeatBal->People(1).sched = Sched::GetScheduleAlwaysOn(*state); // From dataglobals, always returns a 1 for schedule value
    state->dataHeatBal->People(1).AdaptiveCEN15251 = true;

    std::string const idf_objects = delimited_string({
        "Schedule:Constant,OnSch,,1.0;",
        "Schedule:Constant,FreeRunningSeason,,0.0;",
        "Schedule:Constant,Sempre 21,,21.0;",
        "AirflowNetwork:SimulationControl,",
        "  NaturalVentilation,           !- Name",
        "  MultizoneWithoutDistribution, !- AirflowNetwork Control",
        "  SurfaceAverageCalculation,    !- Wind Pressure Coefficient Type",
        "  ,                             !- Height Selection for Local Wind Pressure Calculation",
        "  LOWRISE,                      !- Building Type",
        "  1000,                         !- Maximum Number of Iterations{ dimensionless }",
        "  ZeroNodePressures,            !- Initialization Type",
        "  0.0001,                       !- Relative Airflow Convergence Tolerance{ dimensionless }",
        "  0.0001,                       !- Absolute Airflow Convergence Tolerance{ kg / s }",
        "  -0.5,                         !- Convergence Acceleration Limit{ dimensionless }",
        "  90,                           !- Azimuth Angle of Long Axis of Building{ deg }",
        "  0.36;                         !- Ratio of Building Width Along Short Axis to Width Along Long Axis",
        "AirflowNetwork:MultiZone:Zone,",
        "  Soff,                         !- Zone Name",
        "  CEN15251Adaptive,             !- Ventilation Control Mode",
        "  ,                             !- Ventilation Control Zone Temperature Setpoint Schedule Name",
        "  ,                             !- Minimum Venting Open Factor{ dimensionless }",
        "  ,                             !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor{ deltaC }",
        "  100,                          !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor{ deltaC }",
        "  ,                             !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor{ deltaJ / kg }",
        "  300000,                       !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor{ deltaJ / kg }",
        "  FreeRunningSeason;            !- Venting Availability Schedule Name",
        "AirflowNetwork:MultiZone:Surface,",
        "  window 1,                     !- Surface Name",
        "  Simple Window,                !- Leakage Component Name",
        "  ,                             !- External Node Name",
        "  1,                            !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
        "  ZoneLevel;                    !- Ventilation Control Mode",
        "AirflowNetwork:MultiZone:Surface,",
        "  window 2,                     !- Surface Name",
        "  Simple Window,                !- Leakage Component Name",
        "  ,                             !- External Node Name",
        "  1,                            !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
        "  ZoneLevel;                    !- Ventilation Control Mode",
        "AirflowNetwork:MultiZone:Component:SimpleOpening,",
        "  Simple Window,                !- Name",
        "  0.0010,                       !- Air Mass Flow Coefficient When Opening is Closed{ kg / s - m }",
        "  0.65,                         !- Air Mass Flow Exponent When Opening is Closed{ dimensionless }",
        "  0.01,                         !- Minimum Density Difference for Two - Way Flow{ kg / m3 }",
        "  0.78;                         !- Discharge Coefficient{ dimensionless }",
    });

    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);
    state->afn->get_input();

    EXPECT_ENUM_EQ(AirflowNetwork::SimulationControl::Solver::SkylineLU, state->afn->simulation_control.solver);

    state->dataHeatBal->Zone.deallocate();
    state->dataSurface->Surface.deallocate();
    state->dataHeatBal->People.deallocate();
}

TEST_F(EnergyPlusFixture, AirflowNetworkSimulationControl_SetSolver)
{

    state->dataHeatBal->Zone.allocate(1);
    state->dataHeatBal->Zone(1).Name = "SOFF";

    state->dataSurface->Surface.allocate(2);
    state->dataSurface->Surface(1).Name = "WINDOW 1";
    state->dataSurface->Surface(1).Zone = 1;
    state->dataSurface->Surface(1).ZoneName = "SOFF";
    state->dataSurface->Surface(1).Azimuth = 0.0;
    state->dataSurface->Surface(1).ExtBoundCond = 0;
    state->dataSurface->Surface(1).HeatTransSurf = true;
    state->dataSurface->Surface(1).Tilt = 90.0;
    state->dataSurface->Surface(1).Sides = 4;
    state->dataSurface->Surface(2).Name = "WINDOW 2";
    state->dataSurface->Surface(2).Zone = 1;
    state->dataSurface->Surface(2).ZoneName = "SOFF";
    state->dataSurface->Surface(2).Azimuth = 180.0;
    state->dataSurface->Surface(2).ExtBoundCond = 0;
    state->dataSurface->Surface(2).HeatTransSurf = true;
    state->dataSurface->Surface(2).Tilt = 90.0;
    state->dataSurface->Surface(2).Sides = 4;

    SurfaceGeometry::AllocateSurfaceWindows(*state, 2);
    state->dataSurface->Surface(1).OriginalClass = DataSurfaces::SurfaceClass::Window;
    ;
    state->dataSurface->Surface(2).OriginalClass = DataSurfaces::SurfaceClass::Window;
    ;
    state->dataGlobal->NumOfZones = 1;

    state->dataHeatBal->TotPeople = 1; // Total number of people statements
    state->dataHeatBal->People.allocate(state->dataHeatBal->TotPeople);
    state->dataHeatBal->People(1).ZonePtr = 1;
    state->dataHeatBal->People(1).NumberOfPeople = 100.0;
    state->dataHeatBal->People(1).sched = Sched::GetScheduleAlwaysOn(*state); // From dataglobals, always returns a 1 for schedule value
    state->dataHeatBal->People(1).AdaptiveCEN15251 = true;

    std::string const idf_objects = delimited_string({
        "Schedule:Constant,OnSch,,1.0;",
        "Schedule:Constant,FreeRunningSeason,,0.0;",
        "Schedule:Constant,Sempre 21,,21.0;",
        "AirflowNetwork:SimulationControl,",
        "  NaturalVentilation,           !- Name",
        "  MultizoneWithoutDistribution, !- AirflowNetwork Control",
        "  SurfaceAverageCalculation,    !- Wind Pressure Coefficient Type",
        "  ,                             !- Height Selection for Local Wind Pressure Calculation",
        "  LOWRISE,                      !- Building Type",
        "  1000,                         !- Maximum Number of Iterations{ dimensionless }",
        "  ZeroNodePressures,            !- Initialization Type",
        "  0.0001,                       !- Relative Airflow Convergence Tolerance{ dimensionless }",
        "  0.0001,                       !- Absolute Airflow Convergence Tolerance{ kg / s }",
        "  -0.5,                         !- Convergence Acceleration Limit{ dimensionless }",
        "  90,                           !- Azimuth Angle of Long Axis of Building{ deg }",
        "  1.0,                          !- Ratio of Building Width Along Short Axis to Width Along Long Axis",
        "  No,                           !- Height Dependence of External Node Temperature",
        "  SkylineLU;                    !- Solver",
        "AirflowNetwork:MultiZone:Zone,",
        "  Soff,                         !- Zone Name",
        "  CEN15251Adaptive,             !- Ventilation Control Mode",
        "  ,                             !- Ventilation Control Zone Temperature Setpoint Schedule Name",
        "  ,                             !- Minimum Venting Open Factor{ dimensionless }",
        "  ,                             !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor{ deltaC }",
        "  100,                          !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor{ deltaC }",
        "  ,                             !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor{ deltaJ / kg }",
        "  300000,                       !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor{ deltaJ / kg }",
        "  FreeRunningSeason;            !- Venting Availability Schedule Name",
        "AirflowNetwork:MultiZone:Surface,",
        "  window 1,                     !- Surface Name",
        "  Simple Window,                !- Leakage Component Name",
        "  ,                             !- External Node Name",
        "  1,                            !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
        "  ZoneLevel;                    !- Ventilation Control Mode",
        "AirflowNetwork:MultiZone:Surface,",
        "  window 2,                     !- Surface Name",
        "  Simple Window,                !- Leakage Component Name",
        "  ,                             !- External Node Name",
        "  1,                            !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
        "  ZoneLevel;                    !- Ventilation Control Mode",
        "AirflowNetwork:MultiZone:Component:SimpleOpening,",
        "  Simple Window,                !- Name",
        "  0.0010,                       !- Air Mass Flow Coefficient When Opening is Closed{ kg / s - m }",
        "  0.65,                         !- Air Mass Flow Exponent When Opening is Closed{ dimensionless }",
        "  0.01,                         !- Minimum Density Difference for Two - Way Flow{ kg / m3 }",
        "  0.78;                         !- Discharge Coefficient{ dimensionless }",
    });

    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);

    state->afn->get_input();

    EXPECT_ENUM_EQ(AirflowNetwork::SimulationControl::Solver::SkylineLU, state->afn->simulation_control.solver);

    state->dataHeatBal->Zone.deallocate();
    state->dataSurface->Surface.deallocate();
    state->dataHeatBal->People.deallocate();
}

TEST_F(EnergyPlusFixture, AirflowNetwork_AirThermConductivity)
{

    Real64 constexpr tol = 0.00001;

    EXPECT_NEAR(state->afn->properties.thermal_conductivity(-30), 0.02212, tol);
    EXPECT_NEAR(state->afn->properties.thermal_conductivity(-20), 0.02212, tol);
    EXPECT_NEAR(state->afn->properties.thermal_conductivity(0), 0.02364, tol);
    EXPECT_NEAR(state->afn->properties.thermal_conductivity(20), 0.02514, tol);
    EXPECT_NEAR(state->afn->properties.thermal_conductivity(40), 0.02662, tol);
    EXPECT_NEAR(state->afn->properties.thermal_conductivity(60), 0.02808, tol);
    EXPECT_NEAR(state->afn->properties.thermal_conductivity(70), 0.02881, tol);
    EXPECT_NEAR(state->afn->properties.thermal_conductivity(80), 0.02881, tol);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_AirDynamicVisc)
{

    Real64 constexpr tol = 0.000001;

    EXPECT_NEAR(state->afn->properties.dynamic_viscosity(-30), 1.635e-5, tol);
    EXPECT_NEAR(state->afn->properties.dynamic_viscosity(-20), 1.635e-5, tol);
    EXPECT_NEAR(state->afn->properties.dynamic_viscosity(0), 1.729e-5, tol);
    EXPECT_NEAR(state->afn->properties.dynamic_viscosity(20), 1.823e-5, tol);
    EXPECT_NEAR(state->afn->properties.dynamic_viscosity(40), 1.917e-5, tol);
    EXPECT_NEAR(state->afn->properties.dynamic_viscosity(60), 2.011e-5, tol);
    EXPECT_NEAR(state->afn->properties.dynamic_viscosity(70), 2.058e-5, tol);
    EXPECT_NEAR(state->afn->properties.dynamic_viscosity(80), 2.058e-5, tol);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_AirKinematicVisc)
{

    Real64 constexpr tol = 0.000001;

    EXPECT_NEAR(state->afn->properties.kinematic_viscosity(101000, -30, 0.001), 1.169e-5, tol);
    EXPECT_NEAR(state->afn->properties.kinematic_viscosity(101000, -20, 0.001), 1.169e-5, tol);
    EXPECT_NEAR(state->afn->properties.kinematic_viscosity(101000, 0, 0.001), 1.338e-5, tol);
    EXPECT_NEAR(state->afn->properties.kinematic_viscosity(101000, 20, 0.001), 1.516e-5, tol);
    EXPECT_NEAR(state->afn->properties.kinematic_viscosity(101000, 40, 0.001), 1.702e-5, tol);
    EXPECT_NEAR(state->afn->properties.kinematic_viscosity(101000, 60, 0.001), 1.896e-5, tol);
    EXPECT_NEAR(state->afn->properties.kinematic_viscosity(101000, 70, 0.001), 1.995e-5, tol);
    EXPECT_NEAR(state->afn->properties.kinematic_viscosity(101000, 80, 0.001), 1.995e-5, tol);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_AirThermalDiffusivity)
{

    Real64 constexpr tol = 0.000001;

    EXPECT_NEAR(state->afn->properties.thermal_diffusivity(101000, -30, 0.001), 1.578e-5, tol);
    EXPECT_NEAR(state->afn->properties.thermal_diffusivity(101000, -20, 0.001), 1.578e-5, tol);
    EXPECT_NEAR(state->afn->properties.thermal_diffusivity(101000, 0, 0.001), 1.818e-5, tol);
    EXPECT_NEAR(state->afn->properties.thermal_diffusivity(101000, 20, 0.001), 2.074e-5, tol);
    EXPECT_NEAR(state->afn->properties.thermal_diffusivity(101000, 40, 0.001), 2.346e-5, tol);
    EXPECT_NEAR(state->afn->properties.thermal_diffusivity(101000, 60, 0.001), 2.632e-5, tol);
    EXPECT_NEAR(state->afn->properties.thermal_diffusivity(101000, 70, 0.001), 2.780e-5, tol);
    EXPECT_NEAR(state->afn->properties.thermal_diffusivity(101000, 80, 0.001), 2.780e-5, tol);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_AirPrandtl)
{

    Real64 constexpr tol = 0.0001;

    EXPECT_NEAR(state->afn->properties.prandtl_number(101000, -30, 0.001), 0.7362, tol);
    EXPECT_NEAR(state->afn->properties.prandtl_number(101000, -20, 0.001), 0.7362, tol);
    EXPECT_NEAR(state->afn->properties.prandtl_number(101000, 0, 0.001), 0.7300, tol);
    EXPECT_NEAR(state->afn->properties.prandtl_number(101000, 20, 0.001), 0.7251, tol);
    EXPECT_NEAR(state->afn->properties.prandtl_number(101000, 40, 0.001), 0.7213, tol);
    EXPECT_NEAR(state->afn->properties.prandtl_number(101000, 60, 0.001), 0.7184, tol);
    EXPECT_NEAR(state->afn->properties.prandtl_number(101000, 70, 0.001), 0.7172, tol);
    EXPECT_NEAR(state->afn->properties.prandtl_number(101000, 80, 0.001), 0.7172, tol);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_TestWindPressureTable)
{
    // Test a Table:Lookup object as a wind pressure curve
    std::string const idf_objects = delimited_string({"Table:IndependentVariable,",
                                                      "  Wind_Direction_30_deg,     !- Name",
                                                      "  Linear,                    !- Interpolation Method",
                                                      "  Constant,                  !- Extrapolation Method",
                                                      "  0,                         !- Minimum Value",
                                                      "  360,                       !- Maximum Value",
                                                      "  ,                          !- Normalization Reference Value",
                                                      "  Dimensionless,             !- Unit Type",
                                                      "  ,                          !- External File Name",
                                                      "  ,                          !- External File Column Number",
                                                      "  ,                          !- External File Starting Row Number",
                                                      "  0,                         !- Value 1",
                                                      "  30,",
                                                      "  60,",
                                                      "  90,",
                                                      "  120,",
                                                      "  150,",
                                                      "  180,",
                                                      "  210,",
                                                      "  240,",
                                                      "  270,",
                                                      "  300,",
                                                      "  330,",
                                                      "  360;",

                                                      "Table:IndependentVariableList,",
                                                      "  Wind_Pressure_Variables,   !- Name",
                                                      "  Wind_Direction_30_deg;     !- Independent Variable 1 Name",

                                                      "Table:Lookup,",
                                                      "  EFacade_WPCCurve,          !- Name",
                                                      "  Wind_Pressure_Variables,   !- Independent Variable List Name",
                                                      "  ,                          !- Normalization Method",
                                                      "  ,                          !- Normalization Divisor",
                                                      "  -1,                        !- Minimum Output",
                                                      "  1,                         !- Maximum Output",
                                                      "  Dimensionless,             !- Output Unit Type",
                                                      "  ,                          !- External File Name",
                                                      "  ,                          !- External File Column Number",
                                                      "  ,                          !- External File Starting Row Number",
                                                      "  -0.56,                     !- Output Value 1",
                                                      "  0.04,",
                                                      "  0.48,",
                                                      "  0.6,",
                                                      "  0.48,",
                                                      "  0.04,",
                                                      "  -0.56,",
                                                      "  -0.56,",
                                                      "  -0.42,",
                                                      "  -0.37,",
                                                      "  -0.42,",
                                                      "  -0.56,",
                                                      "  -0.56;"});

    // Load and verify the table
    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);

    ASSERT_EQ(1, state->dataCurveManager->curves.size());
    EXPECT_EQ(1, state->dataCurveManager->curves(1)->numDims);
    EXPECT_EQ("EFACADE_WPCCURVE", Curve::GetCurveName(*state, 1));
    EXPECT_EQ(1, Curve::GetCurveIndex(*state, "EFACADE_WPCCURVE"));
    //    EXPECT_EQ("Table:Lookup", state->dataCurveManager->PerfCurve(1).objectType);
    EXPECT_DOUBLE_EQ(-0.56, Curve::CurveValue(*state, 1, 0.0));   // In-range value
    EXPECT_DOUBLE_EQ(0.54, Curve::CurveValue(*state, 1, 105.0));  // In-range value
    EXPECT_DOUBLE_EQ(-0.56, Curve::CurveValue(*state, 1, -10.0)); // Minimum x
    EXPECT_DOUBLE_EQ(-0.56, Curve::CurveValue(*state, 1, 5000));  // Maximum x
    EXPECT_FALSE(has_err_output());

    // Set up some environmental parameters
    state->dataEnvrn->OutBaroPress = 101325.0;
    state->dataEnvrn->OutDryBulbTemp = 25.0;
    state->dataEnvrn->WindDir = 105.0;
    state->dataEnvrn->OutHumRat = 0.0;        // Dry air only
    state->dataEnvrn->SiteTempGradient = 0.0; // Disconnect z from testing

    // Make sure we can compute the right density
    Real64 rho =
        Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, state->dataEnvrn->OutDryBulbTemp, state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(1.1841123742118911, rho);
    // CalcWindPressure(MultizoneExternalNodeData(i).curve, 1
    //	Vref, 1
    // AirflowNetworkNodeData(n).NodeHeight,  10
    // MultizoneExternalNodeData(i).azimuth, 0
    // MultizoneExternalNodeData(i).symmetricCurve, MultizoneExternalNodeData(i).useRelativeAngle);
    // Compute wind pressure with current defaults
    Real64 windSpeed = 1.0;
    Real64 dryBulb = DataEnvironment::OutDryBulbTempAt(*state, 10.0);
    Real64 azimuth = 0.0;
    Real64 windDir = state->dataEnvrn->WindDir;
    Real64 humRat = state->dataEnvrn->OutHumRat;
    Real64 p = state->afn->calculate_wind_pressure(1, false, false, azimuth, windSpeed, windDir, dryBulb, humRat);
    EXPECT_DOUBLE_EQ(0.54 * 0.5 * 1.1841123742118911, p);
    // Test on an east wall, which has a relative angle of 15 (for wind direction 105)
    azimuth = 90.0;
    p = state->afn->calculate_wind_pressure(1, false, true, azimuth, windSpeed, windDir, dryBulb, humRat);
    EXPECT_DOUBLE_EQ(-0.26 * 0.5 * 1.1841123742118911, p);
    // Test on a wall with azimuth 105, for a zero relative angle
    azimuth = 105.0;
    p = state->afn->calculate_wind_pressure(1, false, true, azimuth, windSpeed, windDir, dryBulb, humRat);
    EXPECT_DOUBLE_EQ(-0.56 * 0.5 * 1.1841123742118911, p);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_TestWPCValue)
{
    // Test loading a WPC object into a Table:Lookup
    std::string const idf_objects = delimited_string({"AirflowNetwork:MultiZone:WindPressureCoefficientArray,",
                                                      "  Every 30 Degrees,        !- Name",
                                                      "  0,                       !- Wind Direction 1 {deg}",
                                                      "  30,                      !- Wind Direction 2 {deg}",
                                                      "  60,                      !- Wind Direction 3 {deg}",
                                                      "  90,                      !- Wind Direction 4 {deg}",
                                                      "  120,                     !- Wind Direction 5 {deg}",
                                                      "  150,                     !- Wind Direction 6 {deg}",
                                                      "  180,                     !- Wind Direction 7 {deg}",
                                                      "  210,                     !- Wind Direction 8 {deg}",
                                                      "  240,                     !- Wind Direction 9 {deg}",
                                                      "  270,                     !- Wind Direction 10 {deg}",
                                                      "  300,                     !- Wind Direction 11 {deg}",
                                                      "  330;                     !- Wind Direction 12 {deg}",
                                                      "AirflowNetwork:MultiZone:WindPressureCoefficientValues,",
                                                      "  NFacade_WPCValue,        !- Name",
                                                      "  Every 30 Degrees,        !- AirflowNetwork:MultiZone:WindPressureCoefficientArray Name",
                                                      "  0.60,                    !- Wind Pressure Coefficient Value 1 {dimensionless}",
                                                      "  0.48,                    !- Wind Pressure Coefficient Value 2 {dimensionless}",
                                                      "  0.04,                    !- Wind Pressure Coefficient Value 3 {dimensionless}",
                                                      "  -0.56,                   !- Wind Pressure Coefficient Value 4 {dimensionless}",
                                                      "  -0.56,                   !- Wind Pressure Coefficient Value 5 {dimensionless}",
                                                      "  -0.42,                   !- Wind Pressure Coefficient Value 6 {dimensionless}",
                                                      "  -0.37,                   !- Wind Pressure Coefficient Value 7 {dimensionless}",
                                                      "  -0.42,                   !- Wind Pressure Coefficient Value 8 {dimensionless}",
                                                      "  -0.56,                   !- Wind Pressure Coefficient Value 9 {dimensionless}",
                                                      "  -0.56,                   !- Wind Pressure Coefficient Value 10 {dimensionless}",
                                                      "  0.04,                    !- Wind Pressure Coefficient Value 11 {dimensionless}",
                                                      "  0.48;                    !- Wind Pressure Coefficient Value 12 {dimensionless}"});

    // Load and verify the table
    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);
    ASSERT_EQ(1, state->dataCurveManager->curves.size());
    EXPECT_EQ(1, state->dataCurveManager->curves(1)->numDims);
    EXPECT_EQ("NFACADE_WPCVALUE", Curve::GetCurveName(*state, 1));
    EXPECT_EQ(1, Curve::GetCurveIndex(*state, "NFACADE_WPCVALUE"));
    //    EXPECT_EQ("AirflowNetwork:MultiZone:WindPressureCoefficientValues", state->dataCurveManager->PerfCurve(1).objectType);
    EXPECT_DOUBLE_EQ(0.6, Curve::CurveValue(*state, 1, 0.0));     // In-range value
    EXPECT_DOUBLE_EQ(-0.56, Curve::CurveValue(*state, 1, 105.0)); // In-range value
    EXPECT_DOUBLE_EQ(0.6, Curve::CurveValue(*state, 1, -10.0));   // Minimum x
    EXPECT_DOUBLE_EQ(0.6, Curve::CurveValue(*state, 1, 5000));    // Maximum x
    EXPECT_FALSE(has_err_output());

    // Set up some environmental parameters
    state->dataEnvrn->OutBaroPress = 101325.0;
    state->dataEnvrn->OutDryBulbTemp = 25.0;
    state->dataEnvrn->WindDir = 105.0;
    state->dataEnvrn->OutHumRat = 0.0;        // Dry air only
    state->dataEnvrn->SiteTempGradient = 0.0; // Disconnect z from testing

    Real64 windSpeed = 1.0;
    Real64 dryBulb = DataEnvironment::OutDryBulbTempAt(*state, 10.0);
    Real64 azimuth = 0.0;
    Real64 windDir = state->dataEnvrn->WindDir;
    Real64 humRat = state->dataEnvrn->OutHumRat;

    // Make sure we can compute the right density
    Real64 rho =
        Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, state->dataEnvrn->OutDryBulbTemp, state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(1.1841123742118911, rho);

    // Compute wind pressure with current defaults
    Real64 p = state->afn->calculate_wind_pressure(1, false, false, azimuth, windSpeed, windDir, dryBulb, humRat);
    EXPECT_DOUBLE_EQ(-0.56 * 0.5 * 1.1841123742118911, p);
    // Test on an east wall, which has a relative angle of 15 (for wind direction 105)
    azimuth = 90.0;
    p = state->afn->calculate_wind_pressure(1, false, true, azimuth, windSpeed, windDir, dryBulb, humRat);
    EXPECT_DOUBLE_EQ(0.54 * 0.5 * 1.1841123742118911, p);
    // Test on a wall with azimuth 105, for a zero relative angle
    azimuth = 105.0;
    p = state->afn->calculate_wind_pressure(1, false, true, azimuth, windSpeed, windDir, dryBulb, humRat);
    EXPECT_DOUBLE_EQ(0.6 * 0.5 * 1.1841123742118911, p);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_TestExternalNodes)
{
    std::string const idf_objects = delimited_string(
        {"Material,",
         "  A1 - 1 IN STUCCO,        !- Name",
         "  Smooth,                  !- Roughness",
         "  2.5389841E-02,           !- Thickness {m}",
         "  0.6918309,               !- Conductivity {W/m-K}",
         "  1858.142,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "Material,",
         "  C4 - 4 IN COMMON BRICK,  !- Name",
         "  Rough,                   !- Roughness",
         "  0.1014984,               !- Thickness {m}",
         "  0.7264224,               !- Conductivity {W/m-K}",
         "  1922.216,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.7600000,               !- Solar Absorptance",
         "  0.7600000;               !- Visible Absorptance",
         "Material,",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD,  !- Name",
         "  Smooth,                  !- Roughness",
         "  1.905E-02,               !- Thickness {m}",
         "  0.7264224,               !- Conductivity {W/m-K}",
         "  1601.846,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "Material,",
         "  C6 - 8 IN CLAY TILE,     !- Name",
         "  Smooth,                  !- Roughness",
         "  0.2033016,               !- Thickness {m}",
         "  0.5707605,               !- Conductivity {W/m-K}",
         "  1121.292,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.8200000,               !- Solar Absorptance",
         "  0.8200000;               !- Visible Absorptance",
         "Material,",
         "  C10 - 8 IN HW CONCRETE,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.2033016,               !- Thickness {m}",
         "  1.729577,                !- Conductivity {W/m-K}",
         "  2242.585,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.6500000,               !- Solar Absorptance",
         "  0.6500000;               !- Visible Absorptance",
         "Material,",
         "  E2 - 1 / 2 IN SLAG OR STONE,  !- Name",
         "  Rough,                   !- Roughness",
         "  1.2710161E-02,           !- Thickness {m}",
         "  1.435549,                !- Conductivity {W/m-K}",
         "  881.0155,                !- Density {kg/m3}",
         "  1673.600,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.5500000,               !- Solar Absorptance",
         "  0.5500000;               !- Visible Absorptance",
         "Material,",
         "  E3 - 3 / 8 IN FELT AND MEMBRANE,  !- Name",
         "  Rough,                   !- Roughness",
         "  9.5402403E-03,           !- Thickness {m}",
         "  0.1902535,               !- Conductivity {W/m-K}",
         "  1121.292,                !- Density {kg/m3}",
         "  1673.600,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.7500000,               !- Solar Absorptance",
         "  0.7500000;               !- Visible Absorptance",
         "Material,",
         "  B5 - 1 IN DENSE INSULATION,  !- Name",
         "  VeryRough,               !- Roughness",
         "  2.5389841E-02,           !- Thickness {m}",
         "  4.3239430E-02,           !- Conductivity {W/m-K}",
         "  91.30524,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.5000000,               !- Solar Absorptance",
         "  0.5000000;               !- Visible Absorptance",
         "Material,",
         "  C12 - 2 IN HW CONCRETE,  !- Name",
         "  MediumRough,             !- Roughness",
         "  5.0901599E-02,           !- Thickness {m}",
         "  1.729577,                !- Conductivity {W/m-K}",
         "  2242.585,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.6500000,               !- Solar Absorptance",
         "  0.6500000;               !- Visible Absorptance",
         "Material,",
         "  1.375in-Solid-Core,      !- Name",
         "  Smooth,                  !- Roughness",
         "  3.4925E-02,              !- Thickness {m}",
         "  0.1525000,               !- Conductivity {W/m-K}",
         "  614.5000,                !- Density {kg/m3}",
         "  1630.0000,               !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "WindowMaterial:Glazing,",
         "  WIN-LAY-GLASS-LIGHT,     !- Name",
         "  SpectralAverage,         !- Optical Data Type",
         "  ,                        !- Window Glass Spectral Data Set Name",
         "  0.0025,                  !- Thickness {m}",
         "  0.850,                   !- Solar Transmittance at Normal Incidence",
         "  0.075,                   !- Front Side Solar Reflectance at Normal Incidence",
         "  0.075,                   !- Back Side Solar Reflectance at Normal Incidence",
         "  0.901,                   !- Visible Transmittance at Normal Incidence",
         "  0.081,                   !- Front Side Visible Reflectance at Normal Incidence",
         "  0.081,                   !- Back Side Visible Reflectance at Normal Incidence",
         "  0.0,                     !- Infrared Transmittance at Normal Incidence",
         "  0.84,                    !- Front Side Infrared Hemispherical Emissivity",
         "  0.84,                    !- Back Side Infrared Hemispherical Emissivity",
         "  0.9;                     !- Conductivity {W/m-K}",
         "Construction,",
         "  DOOR-CON,                !- Name",
         "  1.375in-Solid-Core;      !- Outside Layer",
         "Construction,",
         "  EXTWALL80,               !- Name",
         "  A1 - 1 IN STUCCO,        !- Outside Layer",
         "  C4 - 4 IN COMMON BRICK,  !- Layer 2",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD;  !- Layer 3",
         "Construction,",
         "  PARTITION06,             !- Name",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD,  !- Outside Layer",
         "  C6 - 8 IN CLAY TILE,     !- Layer 2",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD;  !- Layer 3",
         "  Construction,",
         "  FLOOR SLAB 8 IN,         !- Name",
         "  C10 - 8 IN HW CONCRETE;  !- Outside Layer",
         "Construction,",
         "  ROOF34,                  !- Name",
         "  E2 - 1 / 2 IN SLAG OR STONE,  !- Outside Layer",
         "  E3 - 3 / 8 IN FELT AND MEMBRANE,  !- Layer 2",
         "  B5 - 1 IN DENSE INSULATION,  !- Layer 3",
         "  C12 - 2 IN HW CONCRETE;  !- Layer 4",
         "Construction,",
         "  WIN-CON-LIGHT,           !- Name",
         "  WIN-LAY-GLASS-LIGHT;     !- Outside Layer",
         "Zone,",
         "  WEST_ZONE,               !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "Zone,",
         "  EAST_ZONE,               !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "Zone,",
         "  NORTH_ZONE,              !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "GlobalGeometryRules,",
         "  UpperLeftCorner,         !- Starting Vertex Position",
         "  CounterClockWise,        !- Vertex Entry Direction",
         "  World;                   !- Coordinate System",
         "BuildingSurface:Detailed,",
         "  Surface_1,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,0,3.048000,            !- X,Y,Z ==> Vertex 1 {m}",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_2,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0,0,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0,0,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_3,               !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_17,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_4,               !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_10,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_5,               !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_5,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,0,0,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,0,0;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_6,               !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,0,3.048000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,3.048000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_8,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,0,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,0,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_9,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,0,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,0,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_10,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_4,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096001,0,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_11,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_18,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_12,              !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_12,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,0,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,0,0;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_13,              !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,3.048000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,0,3.048000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_14,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_15,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_16,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_17,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_3,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0.000,6.096,3.048,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000,6.096,0.000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096,6.096,0.000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096,6.096,3.048;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_18,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_11,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_19,              !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_19,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,0,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,0;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_20,              !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,3.048000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"FenestrationSurface:Detailed,",
         //"  WINDOW11,                !- Name",
         //"  WINDOW,                  !- Surface Type",
         //"  WIN-CON-LIGHT,           !- Construction Name",
         //"  Surface_1,               !- Building Surface Name",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  0.5000000,               !- View Factor to Ground",
         //"  ,                        !- Frame and Divider Name",
         //"  1.0,                     !- Multiplier",
         //"  3,                       !- Number of Vertices",
         //"  1.00000,0,2.500000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  1.00000,0,1.0000000,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  5.000000,0,1.0000000;  !- X,Y,Z ==> Vertex 3 {m}",
         //"FenestrationSurface:Detailed,",
         //"  WINDOW12,                !- Name",
         //"  WINDOW,                  !- Surface Type",
         //"  WIN-CON-LIGHT,           !- Construction Name",
         //"  Surface_1,               !- Building Surface Name",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  0.5000000,               !- View Factor to Ground",
         //
         //"  4,                       !- Number of Vertices",
         //"  0,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  0,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  0,0,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  0,0,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_3,               !- Name",
         //"  WALL,                    !- Surface Type",
         //"  PARTITION06,             !- Construction Name",
         //"  WEST_ZONE,               !- Zone Name",
         //"  Surface,                 !- Outside Boundary Condition",
         //"  Surface_17,              !- Outside Boundary Condition Object",
         //"  NoSun,                   !- Sun Exposure",
         //"  NoWind,                  !- Wind Exposure",
         //"  0.5000000,               !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  0,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  0,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_4,               !- Name",
         //"  WALL,                    !- Surface Type",
         //"  PARTITION06,             !- Construction Name",
         //"  WEST_ZONE,               !- Zone Name",
         //"  Surface,                 !- Outside Boundary Condition",
         //"  Surface_10,              !- Outside Boundary Condition Object",
         //"  NoSun,                   !- Sun Exposure",
         //"  NoWind,                  !- Wind Exposure",
         //"  0.5000000,               !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  6.096000,0,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  6.096000,0,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_5,               !- Name",
         //"  FLOOR,                   !- Surface Type",
         //"  FLOOR SLAB 8 IN,         !- Construction Name",
         //"  WEST_ZONE,               !- Zone Name",
         //"  Surface,                 !- Outside Boundary Condition",
         //"  Surface_5,               !- Outside Boundary Condition Object",
         //"  NoSun,                   !- Sun Exposure",
         //"  NoWind,                  !- Wind Exposure",
         //"  1.000000,                !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  0,0,0,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  0,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  6.096000,0,0;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_6,               !- Name",
         //"  ROOF,                    !- Surface Type",
         //"  ROOF34,                  !- Construction Name",
         //"  WEST_ZONE,               !- Zone Name",
         //"  Outdoors,                !- Outside Boundary Condition",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  SunExposed,              !- Sun Exposure",
         //"  WindExposed,             !- Wind Exposure",
         //"  0,                       !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  0,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  0,0,3.048000,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  6.096000,0,3.048000,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_8,               !- Name",
         //"  WALL,                    !- Surface Type",
         //"  EXTWALL80,               !- Construction Name",
         //"  EAST_ZONE,               !- Zone Name",
         //"  Outdoors,                !- Outside Boundary Condition",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  SunExposed,              !- Sun Exposure",
         //"  WindExposed,             !- Wind Exposure",
         //"  0.5000000,               !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  6.096000,0,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  6.096000,0,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  12.19200,0,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  12.19200,0,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_9,               !- Name",
         //"  WALL,                    !- Surface Type",
         //"  EXTWALL80,               !- Construction Name",
         //"  EAST_ZONE,               !- Zone Name",
         //"  Outdoors,                !- Outside Boundary Condition",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  SunExposed,              !- Sun Exposure",
         //"  WindExposed,             !- Wind Exposure",
         //"  0.5000000,               !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  12.19200,0,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  12.19200,0,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_10,              !- Name",
         //"  WALL,                    !- Surface Type",
         //"  PARTITION06,             !- Construction Name",
         //"  EAST_ZONE,               !- Zone Name",
         //"  Surface,                 !- Outside Boundary Condition",
         //"  Surface_4,               !- Outside Boundary Condition Object",
         //"  NoSun,                   !- Sun Exposure",
         //"  NoWind,                  !- Wind Exposure",
         //"  0.5000000,               !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  6.096000,0,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  6.096001,0,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_11,              !- Name",
         //"  WALL,                    !- Surface Type",
         //"  PARTITION06,             !- Construction Name",
         //"  EAST_ZONE,               !- Zone Name",
         //"  Surface,                 !- Outside Boundary Condition",
         //"  Surface_18,              !- Outside Boundary Condition Object",
         //"  NoSun,                   !- Sun Exposure",
         //"  NoWind,                  !- Wind Exposure",
         //"  0.5000000,               !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_12,              !- Name",
         //"  FLOOR,                   !- Surface Type",
         //"  FLOOR SLAB 8 IN,         !- Construction Name",
         //"  EAST_ZONE,               !- Zone Name",
         //"  Surface,                 !- Outside Boundary Condition",
         //"  Surface_12,              !- Outside Boundary Condition Object",
         //"  NoSun,                   !- Sun Exposure",
         //"  NoWind,                  !- Wind Exposure",
         //"  1.000000,                !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  6.096000,0,0,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  12.19200,0,0;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_13,              !- Name",
         //"  ROOF,                    !- Surface Type",
         //"  ROOF34,                  !- Construction Name",
         //"  EAST_ZONE,               !- Zone Name",
         //"  Outdoors,                !- Outside Boundary Condition",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  SunExposed,              !- Sun Exposure",
         //"  WindExposed,             !- Wind Exposure",
         //"  0,                       !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  6.096000,0,3.048000,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  12.19200,0,3.048000,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_14,              !- Name",
         //"  WALL,                    !- Surface Type",
         //"  EXTWALL80,               !- Construction Name",
         //"  NORTH_ZONE,              !- Zone Name",
         //"  Outdoors,                !- Outside Boundary Condition",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  SunExposed,              !- Sun Exposure",
         //"  WindExposed,             !- Wind Exposure",
         //"  0.5000000,               !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  0,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  0,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  0,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  0,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_15,              !- Name",
         //"  WALL,                    !- Surface Type",
         //"  EXTWALL80,               !- Construction Name",
         //"  NORTH_ZONE,              !- Zone Name",
         //"  Outdoors,                !- Outside Boundary Condition",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  SunExposed,              !- Sun Exposure",
         //"  WindExposed,             !- Wind Exposure",
         //"  0.5000000,               !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  12.19200,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  0,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  0,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_16,              !- Name",
         //"  WALL,                    !- Surface Type",
         //"  EXTWALL80,               !- Construction Name",
         //"  NORTH_ZONE,              !- Zone Name",
         //"  Outdoors,                !- Outside Boundary Condition",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  SunExposed,              !- Sun Exposure",
         //"  WindExposed,             !- Wind Exposure",
         //"  0.5000000,               !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_17,              !- Name",
         //"  WALL,                    !- Surface Type",
         //"  PARTITION06,             !- Construction Name",
         //"  NORTH_ZONE,              !- Zone Name",
         //"  Surface,                 !- Outside Boundary Condition",
         //"  Surface_3,               !- Outside Boundary Condition Object",
         //"  NoSun,                   !- Sun Exposure",
         //"  NoWind,                  !- Wind Exposure",
         //"  0.5000000,               !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  0.000,6.096,3.048,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  0.000,6.096,0.000,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  6.096,6.096,0.000,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  6.096,6.096,3.048;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_18,              !- Name",
         //"  WALL,                    !- Surface Type",
         //"  PARTITION06,             !- Construction Name",
         //"  NORTH_ZONE,              !- Zone Name",
         //"  Surface,                 !- Outside Boundary Condition",
         //"  Surface_11,              !- Outside Boundary Condition Object",
         //"  NoSun,                   !- Sun Exposure",
         //"  NoWind,                  !- Wind Exposure",
         //"  0.5000000,               !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_19,              !- Name",
         //"  FLOOR,                   !- Surface Type",
         //"  FLOOR SLAB 8 IN,         !- Construction Name",
         //"  NORTH_ZONE,              !- Zone Name",
         //"  Surface,                 !- Outside Boundary Condition",
         //"  Surface_19,              !- Outside Boundary Condition Object",
         //"  NoSun,                   !- Sun Exposure",
         //"  NoWind,                  !- Wind Exposure",
         //"  1.000000,                !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  0,6.096000,0,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  0,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  12.19200,6.096000,0;  !- X,Y,Z ==> Vertex 4 {m}",
         //"BuildingSurface:Detailed,",
         //"  Surface_20,              !- Name",
         //"  ROOF,                    !- Surface Type",
         //"  ROOF34,                  !- Construction Name",
         //"  NORTH_ZONE,              !- Zone Name",
         //"  Outdoors,                !- Outside Boundary Condition",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  SunExposed,              !- Sun Exposure",
         //"  WindExposed,             !- Wind Exposure",
         //"  0,                       !- View Factor to Ground",
         //"  4,                       !- Number of Vertices",
         //"  0,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  0,6.096000,3.048000,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"FenestrationSurface:Detailed,",
         //"  WINDOW11,                !- Name",
         //"  WINDOW,                  !- Surface Type",
         //"  WIN-CON-LIGHT,           !- Construction Name",
         //"  Surface_1,               !- Building Surface Name",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  0.5000000,               !- View Factor to Ground",
         //"  ,                        !- Frame and Divider Name",
         //"  1.0,                     !- Multiplier",
         //"  3,                       !- Number of Vertices",
         //"  1.00000,0,2.500000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  1.00000,0,1.0000000,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  5.000000,0,1.0000000;  !- X,Y,Z ==> Vertex 3 {m}",
         //"FenestrationSurface:Detailed,",
         //"  WINDOW12,                !- Name",
         //"  WINDOW,                  !- Surface Type",
         //"  WIN-CON-LIGHT,           !- Construction Name",
         //"  Surface_1,               !- Building Surface Name",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  0.5000000,               !- View Factor to Ground",
         //"  ,                        !- Frame and Divider Name",
         //"  1.0,                     !- Multiplier",
         //"  3,                       !- Number of Vertices",
         //"  5.00000,0,1.0000000,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  5.000000,0,2.5000000,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  1.000000,0,2.500000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"FenestrationSurface:Detailed,",
         //"  DoorInSurface_3,         !- Name",
         //"  DOOR,                    !- Surface Type",
         //"  DOOR-CON,                !- Construction Name",
         //"  Surface_3,               !- Building Surface Name",
         //"  DoorInSurface_17,        !- Outside Boundary Condition Object",
         //"  0.5000000,               !- View Factor to Ground",
         //"  ,                        !- Frame and Divider Name",
         //"  1.0,                     !- Multiplier",
         //"  4,                       !- Number of Vertices",
         //"  3.500,6.096000,2.0,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  3.500,6.096000,0.0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  2.500,6.096000,0.0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  2.500,6.096000,2.0;  !- X,Y,Z ==> Vertex 4 {m}",
         //"FenestrationSurface:Detailed,",
         //"  WINDOW2,                 !- Name",
         //"  WINDOW,                  !- Surface Type",
         //"  WIN-CON-LIGHT,           !- Construction Name",
         //"  Surface_15,              !- Building Surface Name",
         //"  ,                        !- Outside Boundary Condition Object",
         //"  0.5000000,               !- View Factor to Ground",
         //"  ,                        !- Frame and Divider Name",
         //"  1.0,                     !- Multiplier",
         //"  4,                       !- Number of Vertices",
         //"  6.000000,12.19200,2.333000,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  6.000000,12.19200,1.000000,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  3.000000,12.19200,1.000000,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  3.000000,12.19200,2.333000;  !- X,Y,Z ==> Vertex 4 {m}",
         //"FenestrationSurface:Detailed,",
         //"  DoorInSurface_17,        !- Name",
         //"  DOOR,                    !- Surface Type",
         //"  DOOR-CON,                !- Construction Name",
         //"  Surface_17,              !- Building Surface Name",
         //"  DoorInSurface_3,         !- Outside Boundary Condition Object",
         //"  0.5000000,               !- View Factor to Ground",
         //"  ,                        !- Frame and Divider Name",
         //"  1.0,                     !- Multiplier",
         //"  4,                       !- Number of Vertices",
         //"  2.500,6.096000,2.0,  !- X,Y,Z ==> Vertex 1 {m}",
         //"  2.500,6.096000,0.0,  !- X,Y,Z ==> Vertex 2 {m}",
         //"  3.500,6.096000,0.0,  !- X,Y,Z ==> Vertex 3 {m}",
         //"  3.500,6.096000,2.0;  !- X,Y,Z ==> Vertex 4 {m}",
         "AirflowNetwork:SimulationControl,",
         "  NaturalVentilation,      !- Name",
         "  MultizoneWithoutDistribution,  !- AirflowNetwork Control",
         "  INPUT,                   !- Wind Pressure Coefficient Type",
         "  ExternalNode,            !- Height Selection for Local Wind Pressure Calculation",
         "  LOWRISE,                 !- Building Type",
         "  500,                     !- Maximum Number of Iterations {dimensionless}",
         "  ZeroNodePressures,       !- Initialization Type",
         "  1.0E-05,                 !- Relative Airflow Convergence Tolerance {dimensionless}",
         "  1.0E-06,                 !- Absolute Airflow Convergence Tolerance {kg/s}",
         "  -0.5,                    !- Convergence Acceleration Limit {dimensionless}",
         "  0.0,                     !- Azimuth Angle of Long Axis of Building {deg}",
         "  1.0;                     !- Ratio of Building Width Along Short Axis to Width Along Long Axis",
         "AirflowNetwork:MultiZone:Zone,",
         "  WEST_ZONE,               !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         //"  Temperature,             !- Ventilation Control Mode",
         //"  WindowVentSched,         !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  0.3,                     !- Minimum Venting Open Factor {dimensionless}",
         "  5.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  10.0,                    !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Zone,",
         "  EAST_ZONE,               !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  1.0,                     !- Minimum Venting Open Factor {dimensionless}",
         "  0.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  100.0,                   !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Zone,",
         "  NORTH_ZONE,              !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         //"  Temperature,             !- Ventilation Control Mode",
         //"  WindowVentSched,         !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  1.0,                     !- Minimum Venting Open Factor {dimensionless}",
         "  0.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  100.0,                   !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_1,               !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  SFacade,                 !- External Node Name",
         "  1.0;                     !- Window/Door Opening Factor, or Crack Factor {dimensionless}",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_4,               !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_11,              !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_15,              !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  NFacade,                 !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:ExternalNode,",
         "  NFacade,                 !- Name",
         "  1.524,                   !- External Node Height{ m }",
         "  NFacade_WPCValue;        !- Wind Pressure Coefficient Values Object Name",
         "AirflowNetwork:MultiZone:ExternalNode,",
         "  SFacade,                 !- Name",
         "  1.524,                   !- External Node Height{ m }",
         "  SFacade_WPCValue,        !- Wind Pressure Coefficient Values Object Name",
         "  No,                      !- Symmetric Wind Pressure Coefficient Curve",
         "  Absolute;                !- Wind Angle Type",
         "AirflowNetwork:MultiZone:ReferenceCrackConditions,",
         "  ReferenceCrackConditions,!- Name",
         "  20.0,                    !- Reference Temperature{ C }",
         "  101320,                  !- Reference Barometric Pressure{ Pa }",
         "  0.005;                   !- Reference Humidity Ratio{ kgWater / kgDryAir }",
         "AirflowNetwork:MultiZone:Surface:Crack,",
         "  CR-1,                    !- Name",
         "  0.01,                    !- Air Mass Flow Coefficient at Reference Conditions{ kg / s }",
         "  0.667,                   !- Air Mass Flow Exponent{ dimensionless }",
         "  ReferenceCrackConditions;!- Reference Crack Conditions",
         "AirflowNetwork:MultiZone:WindPressureCoefficientArray,",
         "  Every 30 Degrees,        !- Name",
         "  0,                       !- Wind Direction 1 {deg}",
         "  30,                      !- Wind Direction 2 {deg}",
         "  60,                      !- Wind Direction 3 {deg}",
         "  90,                      !- Wind Direction 4 {deg}",
         "  120,                     !- Wind Direction 5 {deg}",
         "  150,                     !- Wind Direction 6 {deg}",
         "  180,                     !- Wind Direction 7 {deg}",
         "  210,                     !- Wind Direction 8 {deg}",
         "  240,                     !- Wind Direction 9 {deg}",
         "  270,                     !- Wind Direction 10 {deg}",
         "  300,                     !- Wind Direction 11 {deg}",
         "  330;                     !- Wind Direction 12 {deg}",
         "AirflowNetwork:MultiZone:WindPressureCoefficientValues,",
         "  NFacade_WPCValue,        !- Name",
         "  Every 30 Degrees,        !- AirflowNetwork:MultiZone:WindPressureCoefficientArray Name",
         "  0.60,                    !- Wind Pressure Coefficient Value 1 {dimensionless}",
         "  0.48,                    !- Wind Pressure Coefficient Value 2 {dimensionless}",
         "  0.04,                    !- Wind Pressure Coefficient Value 3 {dimensionless}",
         "  -0.56,                   !- Wind Pressure Coefficient Value 4 {dimensionless}",
         "  -0.56,                   !- Wind Pressure Coefficient Value 5 {dimensionless}",
         "  -0.42,                   !- Wind Pressure Coefficient Value 6 {dimensionless}",
         "  -0.37,                   !- Wind Pressure Coefficient Value 7 {dimensionless}",
         "  -0.42,                   !- Wind Pressure Coefficient Value 8 {dimensionless}",
         "  -0.56,                   !- Wind Pressure Coefficient Value 9 {dimensionless}",
         "  -0.56,                   !- Wind Pressure Coefficient Value 10 {dimensionless}",
         "  0.04,                    !- Wind Pressure Coefficient Value 11 {dimensionless}",
         "  0.48;                    !- Wind Pressure Coefficient Value 12 {dimensionless}",
         "AirflowNetwork:MultiZone:WindPressureCoefficientValues,",
         "  SFacade_WPCValue,        !- Name",
         "  Every 30 Degrees,        !- AirflowNetwork:MultiZone:WindPressureCoefficientArray Name",
         "  -0.37,                   !- Wind Pressure Coefficient Value 1 {dimensionless}",
         "  -0.42,                   !- Wind Pressure Coefficient Value 2 {dimensionless}",
         "  -0.56,                   !- Wind Pressure Coefficient Value 3 {dimensionless}",
         "  -0.56,                   !- Wind Pressure Coefficient Value 4 {dimensionless}",
         "  0.04,                    !- Wind Pressure Coefficient Value 5 {dimensionless}",
         "  0.48,                    !- Wind Pressure Coefficient Value 6 {dimensionless}",
         "  0.60,                    !- Wind Pressure Coefficient Value 7 {dimensionless}",
         "  0.48,                    !- Wind Pressure Coefficient Value 8 {dimensionless}",
         "  0.04,                    !- Wind Pressure Coefficient Value 9 {dimensionless}",
         "  -0.56,                   !- Wind Pressure Coefficient Value 10 {dimensionless}",
         "  -0.56,                   !- Wind Pressure Coefficient Value 11 {dimensionless}",
         "  -0.42;                   !- Wind Pressure Coefficient Value 12 {dimensionless}",
         "SurfaceConvectionAlgorithm:Inside,TARP;",
         "SurfaceConvectionAlgorithm:Outside,DOE-2;",
         "HeatBalanceAlgorithm,ConductionTransferFunction;",
         "ZoneAirHeatBalanceAlgorithm,",
         "  AnalyticalSolution;      !- Algorithm"});
    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);

    bool errors = false;

    Material::GetMaterialData(*state, errors); // read material data
    EXPECT_FALSE(errors);                      // expect no errors

    HeatBalanceManager::GetConstructData(*state, errors); // read construction data
    EXPECT_FALSE(errors);                                 // expect no errors

    HeatBalanceManager::GetZoneData(*state, errors); // read zone data
    EXPECT_FALSE(errors);                            // expect no errors

    // Magic to get surfaces read in correctly
    state->dataHeatBal->AnyCTF = true;
    state->dataSurfaceGeometry->CosBldgRotAppGonly = 1.0;
    state->dataSurfaceGeometry->SinBldgRotAppGonly = 0.0;

    SurfaceGeometry::GetSurfaceData(*state, errors); // setup zone geometry and get zone data
    EXPECT_FALSE(errors);                            // expect no errors

    EXPECT_EQ(state->dataCurveManager->curves.size(), 2);

    state->afn->get_input();

    // Check the airflow elements
    EXPECT_EQ(2u, state->afn->MultizoneExternalNodeData.size());
    EXPECT_EQ(3u, state->afn->MultizoneZoneData.size());
    EXPECT_EQ(4u, state->afn->MultizoneSurfaceData.size());
    EXPECT_EQ(1u, state->afn->MultizoneSurfaceCrackData.size());

    EXPECT_EQ(0.0, state->afn->MultizoneExternalNodeData(1).azimuth);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(1).symmetricCurve);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(1).useRelativeAngle);
    EXPECT_EQ(1, state->afn->MultizoneExternalNodeData(1).curve);

    EXPECT_EQ(180.0, state->afn->MultizoneExternalNodeData(2).azimuth);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(2).symmetricCurve);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(2).useRelativeAngle);
    EXPECT_EQ(2, state->afn->MultizoneExternalNodeData(2).curve);

    // Set up some environmental parameters
    state->dataEnvrn->OutBaroPress = 101325.0;
    state->dataEnvrn->OutDryBulbTemp = 25.0;
    state->dataEnvrn->WindDir = 105.0;
    state->dataEnvrn->OutHumRat = 0.0;        // Dry air only
    state->dataEnvrn->SiteTempGradient = 0.0; // Disconnect z from testing
    state->dataEnvrn->SiteWindExp = 0.0;      // Disconnect variation by height
    state->dataEnvrn->WindSpeed = 10.0;

    // Make sure we can compute the right wind pressure
    Real64 rho =
        Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, state->dataEnvrn->OutDryBulbTemp, state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(1.1841123742118911, rho);
    Real64 p = state->afn->calculate_wind_pressure(state->afn->MultizoneExternalNodeData(1).curve,
                                                   false,
                                                   false,
                                                   0.0,
                                                   1.0,
                                                   state->dataEnvrn->WindDir,
                                                   DataEnvironment::OutDryBulbTempAt(*state, 10.0),
                                                   state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(-0.56 * 0.5 * 1.1841123742118911, p);

    // Make sure the reference velocity comes out right
    EXPECT_DOUBLE_EQ(10.0, DataEnvironment::WindSpeedAt(*state, state->afn->MultizoneExternalNodeData(1).height));

    EXPECT_EQ(5u, state->afn->AirflowNetworkNodeSimu.size());

    // Run the balance routine, for now only to get the pressure set at the external nodes
    state->afn->calculate_balance();

    EXPECT_DOUBLE_EQ(-0.56 * 0.5 * 118.41123742118911, state->afn->AirflowNetworkNodeSimu(4).PZ);
    EXPECT_DOUBLE_EQ(-0.26 * 0.5 * 118.41123742118911, state->afn->AirflowNetworkNodeSimu(5).PZ);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_TestExternalNodesWithTables)
{
    std::string const idf_objects = delimited_string(
        {"Material,",
         "  A1 - 1 IN STUCCO,        !- Name",
         "  Smooth,                  !- Roughness",
         "  2.5389841E-02,           !- Thickness {m}",
         "  0.6918309,               !- Conductivity {W/m-K}",
         "  1858.142,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "Material,",
         "  C4 - 4 IN COMMON BRICK,  !- Name",
         "  Rough,                   !- Roughness",
         "  0.1014984,               !- Thickness {m}",
         "  0.7264224,               !- Conductivity {W/m-K}",
         "  1922.216,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.7600000,               !- Solar Absorptance",
         "  0.7600000;               !- Visible Absorptance",
         "Material,",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD,  !- Name",
         "  Smooth,                  !- Roughness",
         "  1.905E-02,               !- Thickness {m}",
         "  0.7264224,               !- Conductivity {W/m-K}",
         "  1601.846,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "Material,",
         "  C6 - 8 IN CLAY TILE,     !- Name",
         "  Smooth,                  !- Roughness",
         "  0.2033016,               !- Thickness {m}",
         "  0.5707605,               !- Conductivity {W/m-K}",
         "  1121.292,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.8200000,               !- Solar Absorptance",
         "  0.8200000;               !- Visible Absorptance",
         "Material,",
         "  C10 - 8 IN HW CONCRETE,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.2033016,               !- Thickness {m}",
         "  1.729577,                !- Conductivity {W/m-K}",
         "  2242.585,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.6500000,               !- Solar Absorptance",
         "  0.6500000;               !- Visible Absorptance",
         "Material,",
         "  E2 - 1 / 2 IN SLAG OR STONE,  !- Name",
         "  Rough,                   !- Roughness",
         "  1.2710161E-02,           !- Thickness {m}",
         "  1.435549,                !- Conductivity {W/m-K}",
         "  881.0155,                !- Density {kg/m3}",
         "  1673.600,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.5500000,               !- Solar Absorptance",
         "  0.5500000;               !- Visible Absorptance",
         "Material,",
         "  E3 - 3 / 8 IN FELT AND MEMBRANE,  !- Name",
         "  Rough,                   !- Roughness",
         "  9.5402403E-03,           !- Thickness {m}",
         "  0.1902535,               !- Conductivity {W/m-K}",
         "  1121.292,                !- Density {kg/m3}",
         "  1673.600,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.7500000,               !- Solar Absorptance",
         "  0.7500000;               !- Visible Absorptance",
         "Material,",
         "  B5 - 1 IN DENSE INSULATION,  !- Name",
         "  VeryRough,               !- Roughness",
         "  2.5389841E-02,           !- Thickness {m}",
         "  4.3239430E-02,           !- Conductivity {W/m-K}",
         "  91.30524,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.5000000,               !- Solar Absorptance",
         "  0.5000000;               !- Visible Absorptance",
         "Material,",
         "  C12 - 2 IN HW CONCRETE,  !- Name",
         "  MediumRough,             !- Roughness",
         "  5.0901599E-02,           !- Thickness {m}",
         "  1.729577,                !- Conductivity {W/m-K}",
         "  2242.585,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.6500000,               !- Solar Absorptance",
         "  0.6500000;               !- Visible Absorptance",
         "Material,",
         "  1.375in-Solid-Core,      !- Name",
         "  Smooth,                  !- Roughness",
         "  3.4925E-02,              !- Thickness {m}",
         "  0.1525000,               !- Conductivity {W/m-K}",
         "  614.5000,                !- Density {kg/m3}",
         "  1630.0000,               !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "WindowMaterial:Glazing,",
         "  WIN-LAY-GLASS-LIGHT,     !- Name",
         "  SpectralAverage,         !- Optical Data Type",
         "  ,                        !- Window Glass Spectral Data Set Name",
         "  0.0025,                  !- Thickness {m}",
         "  0.850,                   !- Solar Transmittance at Normal Incidence",
         "  0.075,                   !- Front Side Solar Reflectance at Normal Incidence",
         "  0.075,                   !- Back Side Solar Reflectance at Normal Incidence",
         "  0.901,                   !- Visible Transmittance at Normal Incidence",
         "  0.081,                   !- Front Side Visible Reflectance at Normal Incidence",
         "  0.081,                   !- Back Side Visible Reflectance at Normal Incidence",
         "  0.0,                     !- Infrared Transmittance at Normal Incidence",
         "  0.84,                    !- Front Side Infrared Hemispherical Emissivity",
         "  0.84,                    !- Back Side Infrared Hemispherical Emissivity",
         "  0.9;                     !- Conductivity {W/m-K}",
         "Construction,",
         "  DOOR-CON,                !- Name",
         "  1.375in-Solid-Core;      !- Outside Layer",
         "Construction,",
         "  EXTWALL80,               !- Name",
         "  A1 - 1 IN STUCCO,        !- Outside Layer",
         "  C4 - 4 IN COMMON BRICK,  !- Layer 2",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD;  !- Layer 3",
         "Construction,",
         "  PARTITION06,             !- Name",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD,  !- Outside Layer",
         "  C6 - 8 IN CLAY TILE,     !- Layer 2",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD;  !- Layer 3",
         "  Construction,",
         "  FLOOR SLAB 8 IN,         !- Name",
         "  C10 - 8 IN HW CONCRETE;  !- Outside Layer",
         "Construction,",
         "  ROOF34,                  !- Name",
         "  E2 - 1 / 2 IN SLAG OR STONE,  !- Outside Layer",
         "  E3 - 3 / 8 IN FELT AND MEMBRANE,  !- Layer 2",
         "  B5 - 1 IN DENSE INSULATION,  !- Layer 3",
         "  C12 - 2 IN HW CONCRETE;  !- Layer 4",
         "Construction,",
         "  WIN-CON-LIGHT,           !- Name",
         "  WIN-LAY-GLASS-LIGHT;     !- Outside Layer",
         "Zone,",
         "  WEST_ZONE,               !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "Zone,",
         "  EAST_ZONE,               !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "Zone,",
         "  NORTH_ZONE,              !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "GlobalGeometryRules,",
         "  UpperLeftCorner,         !- Starting Vertex Position",
         "  CounterClockWise,        !- Vertex Entry Direction",
         "  World;                   !- Coordinate System",
         "BuildingSurface:Detailed,",
         "  Surface_1,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,0,3.048000,            !- X,Y,Z ==> Vertex 1 {m}",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_2,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 3 {m}",
         "  0,0,3.048000;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_3,               !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_17,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  0,6.096000,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_4,               !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_10,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_5,               !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_5,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,0,0;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_6,               !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,0,3.048000,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_8,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_9,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_10,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_4,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096001,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_11,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_18,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_12,              !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_12,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,0,0;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_13,              !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,0,3.048000,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_14,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,12.19200,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,12.19200,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  0,6.096000,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_15,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_16,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_17,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_3,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0.000,6.096,3.048,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000,6.096,0.000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096,6.096,0.000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096,6.096,3.048;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_18,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_11,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_19,              !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_19,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,0,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,0;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_20,              !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,3.048000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "AirflowNetwork:SimulationControl,",
         "  NaturalVentilation,      !- Name",
         "  MultizoneWithoutDistribution,  !- AirflowNetwork Control",
         "  INPUT,                   !- Wind Pressure Coefficient Type",
         "  ExternalNode,            !- Height Selection for Local Wind Pressure Calculation",
         "  LOWRISE,                 !- Building Type",
         "  500,                     !- Maximum Number of Iterations {dimensionless}",
         "  ZeroNodePressures,       !- Initialization Type",
         "  1.0E-05,                 !- Relative Airflow Convergence Tolerance {dimensionless}",
         "  1.0E-06,                 !- Absolute Airflow Convergence Tolerance {kg/s}",
         "  -0.5,                    !- Convergence Acceleration Limit {dimensionless}",
         "  0.0,                     !- Azimuth Angle of Long Axis of Building {deg}",
         "  1.0;                     !- Ratio of Building Width Along Short Axis to Width Along Long Axis",
         "AirflowNetwork:MultiZone:Zone,",
         "  WEST_ZONE,               !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         //"  Temperature,             !- Ventilation Control Mode",
         //"  WindowVentSched,         !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  0.3,                     !- Minimum Venting Open Factor {dimensionless}",
         "  5.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  10.0,                    !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Zone,",
         "  EAST_ZONE,               !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  1.0,                     !- Minimum Venting Open Factor {dimensionless}",
         "  0.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  100.0,                   !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Zone,",
         "  NORTH_ZONE,              !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         //"  Temperature,             !- Ventilation Control Mode",
         //"  WindowVentSched,         !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  1.0,                     !- Minimum Venting Open Factor {dimensionless}",
         "  0.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  100.0,                   !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_1,               !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  SFacade,                 !- External Node Name",
         "  1.0;                     !- Window/Door Opening Factor, or Crack Factor {dimensionless}",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_4,               !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_11,              !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_15,              !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  NFacade,                 !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:ExternalNode,",
         "  NFacade,                 !- Name",
         "  1.524,                   !- External Node Height{ m }",
         "  NFacade_WPCCurve;        !- Wind Pressure Coefficient Values Object Name",
         "AirflowNetwork:MultiZone:ExternalNode,",
         "  SFacade,                 !- Name",
         "  1.524,                   !- External Node Height{ m }",
         "  SFacade_WPCCurve,        !- Wind Pressure Coefficient Values Object Name",
         "  No,                      !- Symmetric Wind Pressure Coefficient Curve",
         "  Absolute;                !- Wind Angle Type",
         "AirflowNetwork:MultiZone:ReferenceCrackConditions,",
         "  ReferenceCrackConditions,!- Name",
         "  20.0,                    !- Reference Temperature{ C }",
         "  101320,                  !- Reference Barometric Pressure{ Pa }",
         "  0.005;                   !- Reference Humidity Ratio{ kgWater / kgDryAir }",
         "AirflowNetwork:MultiZone:Surface:Crack,",
         "  CR-1,                    !- Name",
         "  0.01,                    !- Air Mass Flow Coefficient at Reference Conditions{ kg / s }",
         "  0.667,                   !- Air Mass Flow Exponent{ dimensionless }",
         "  ReferenceCrackConditions;!- Reference Crack Conditions",

         "Table:IndependentVariable,",
         "  Wind_Direction_30_deg,     !- Name",
         "  Linear,                    !- Interpolation Method",
         "  Constant,                  !- Extrapolation Method",
         "  0,                         !- Minimum Value",
         "  360,                       !- Maximum Value",
         "  ,                          !- Normalization Reference Value",
         "  Dimensionless,             !- Unit Type",
         "  ,                          !- External File Name",
         "  ,                          !- External File Column Number",
         "  ,                          !- External File Starting Row Number",
         "  0,                         !- Value 1",
         "  30,",
         "  60,",
         "  90,",
         "  120,",
         "  150,",
         "  180,",
         "  210,",
         "  240,",
         "  270,",
         "  300,",
         "  330,",
         "  360;",

         "Table:IndependentVariableList,",
         "  Wind_Pressure_Variables,   !- Name",
         "  Wind_Direction_30_deg;     !- Independent Variable 1 Name",

         "Table:Lookup,",
         "  NFacade_WPCCurve,          !- Name",
         "  Wind_Pressure_Variables,   !- Independent Variable List Name",
         "  ,                          !- Normalization Method",
         "  ,                          !- Normalization Divisor",
         "  -1,                        !- Minimum Output",
         "  1,                         !- Maximum Output",
         "  Dimensionless,             !- Output Unit Type",
         "  ,                          !- External File Name",
         "  ,                          !- External File Column Number",
         "  ,                          !- External File Starting Row Number",
         "  0.60,                      !- Output Value 1",
         "  0.48,",
         "  0.04,",
         "  -0.56,",
         "  -0.56,",
         "  -0.42,",
         "  -0.37,",
         "  -0.42,",
         "  -0.56,",
         "  -0.56,",
         "  0.04,",
         "  0.48,",
         "  0.60;",

         "Table:Lookup,",
         "  SFacade_WPCCurve,          !- Name",
         "  Wind_Pressure_Variables,   !- Independent Variable List Name",
         "  ,                          !- Normalization Method",
         "  ,                          !- Normalization Divisor",
         "  -1,                        !- Minimum Output",
         "  1,                         !- Maximum Output",
         "  Dimensionless,             !- Output Unit Type",
         "  ,                          !- External File Name",
         "  ,                          !- External File Column Number",
         "  ,                          !- External File Starting Row Number",
         "  -0.37,                     !- Output Value 1",
         "  -0.42,",
         "  -0.56,",
         "  -0.56,",
         "  0.04,",
         "  0.48,",
         "  0.60,",
         "  0.48,",
         "  0.04,",
         "  -0.56,",
         "  -0.56,",
         "  -0.42,",
         "  -0.37;",

         "SurfaceConvectionAlgorithm:Inside,TARP;",
         "SurfaceConvectionAlgorithm:Outside,DOE-2;",
         "HeatBalanceAlgorithm,ConductionTransferFunction;",
         "ZoneAirHeatBalanceAlgorithm,",
         "  AnalyticalSolution;      !- Algorithm"});
    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);

    bool errors = false;

    Material::GetMaterialData(*state, errors); // read material data
    EXPECT_FALSE(errors);                      // expect no errors

    HeatBalanceManager::GetConstructData(*state, errors); // read construction data
    EXPECT_FALSE(errors);                                 // expect no errors

    HeatBalanceManager::GetZoneData(*state, errors); // read zone data
    EXPECT_FALSE(errors);                            // expect no errors

    // Magic to get surfaces read in correctly
    state->dataHeatBal->AnyCTF = true;
    state->dataSurfaceGeometry->CosBldgRotAppGonly = 1.0;
    state->dataSurfaceGeometry->SinBldgRotAppGonly = 0.0;

    SurfaceGeometry::GetSurfaceData(*state, errors); // setup zone geometry and get zone data
    EXPECT_FALSE(errors);                            // expect no errors

    EXPECT_EQ(state->dataCurveManager->curves.size(), 2);

    state->afn->get_input();

    // Check the airflow elements
    EXPECT_EQ(2u, state->afn->MultizoneExternalNodeData.size());
    EXPECT_EQ(3u, state->afn->MultizoneZoneData.size());
    EXPECT_EQ(4u, state->afn->MultizoneSurfaceData.size());
    EXPECT_EQ(1u, state->afn->MultizoneSurfaceCrackData.size());

    EXPECT_EQ(0.0, state->afn->MultizoneExternalNodeData(1).azimuth);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(1).symmetricCurve);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(1).useRelativeAngle);
    EXPECT_EQ(1, state->afn->MultizoneExternalNodeData(1).curve);

    EXPECT_EQ(180.0, state->afn->MultizoneExternalNodeData(2).azimuth);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(2).symmetricCurve);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(2).useRelativeAngle);
    EXPECT_EQ(2, state->afn->MultizoneExternalNodeData(2).curve);

    // Set up some environmental parameters
    state->dataEnvrn->OutBaroPress = 101325.0;
    state->dataEnvrn->OutDryBulbTemp = 25.0;
    state->dataEnvrn->WindDir = 105.0;
    state->dataEnvrn->OutHumRat = 0.0;        // Dry air only
    state->dataEnvrn->SiteTempGradient = 0.0; // Disconnect z from testing
    state->dataEnvrn->SiteWindExp = 0.0;      // Disconnect variation by height
    state->dataEnvrn->WindSpeed = 10.0;

    // Make sure we can compute the right wind pressure
    Real64 rho =
        Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, state->dataEnvrn->OutDryBulbTemp, state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(1.1841123742118911, rho);
    Real64 p = state->afn->calculate_wind_pressure(state->afn->MultizoneExternalNodeData(1).curve,
                                                   false,
                                                   false,
                                                   0.0,
                                                   1.0,
                                                   state->dataEnvrn->WindDir,
                                                   DataEnvironment::OutDryBulbTempAt(*state, 10.0),
                                                   state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(-0.56 * 0.5 * 1.1841123742118911, p);

    // Make sure the reference velocity comes out right
    EXPECT_DOUBLE_EQ(10.0, DataEnvironment::WindSpeedAt(*state, state->afn->MultizoneExternalNodeData(1).height));

    EXPECT_EQ(5u, state->afn->AirflowNetworkNodeSimu.size());

    // Run the balance routine, for now only to get the pressure set at the external nodes
    state->afn->calculate_balance();

    EXPECT_DOUBLE_EQ(-0.56 * 0.5 * 118.41123742118911, state->afn->AirflowNetworkNodeSimu(4).PZ);
    EXPECT_DOUBLE_EQ(-0.26 * 0.5 * 118.41123742118911, state->afn->AirflowNetworkNodeSimu(5).PZ);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_TestExternalNodesWithNoInput)
{
    std::string const idf_objects = delimited_string(
        {"Curve:Quartic,",
         "  WindPressureFit,         !- Name",
         "  0.592,                   !- Coefficient1 Constant",
         "  0.0148,                  !- Coefficient2 x",
         "  -.000757,                !- Coefficient3 x**2",
         "  0.00000662,              !- Coefficient4 x**3",
         "  -.0000000169,            !- Coefficient5 x**4",
         "  0,                       !- Minimum Value of x",
         "  180,                     !- Maximum Value of x",
         "  -1,                      !- Minimum Curve Output",
         "  1,                       !- Maximum Curve Output",
         "  Dimensionless,           !- Input Unit Type for X",
         "  Dimensionless;           !- Output Unit Type",
         "Material,",
         "  A1 - 1 IN STUCCO,        !- Name",
         "  Smooth,                  !- Roughness",
         "  2.5389841E-02,           !- Thickness {m}",
         "  0.6918309,               !- Conductivity {W/m-K}",
         "  1858.142,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "Material,",
         "  C4 - 4 IN COMMON BRICK,  !- Name",
         "  Rough,                   !- Roughness",
         "  0.1014984,               !- Thickness {m}",
         "  0.7264224,               !- Conductivity {W/m-K}",
         "  1922.216,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.7600000,               !- Solar Absorptance",
         "  0.7600000;               !- Visible Absorptance",
         "Material,",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD,  !- Name",
         "  Smooth,                  !- Roughness",
         "  1.905E-02,               !- Thickness {m}",
         "  0.7264224,               !- Conductivity {W/m-K}",
         "  1601.846,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "Material,",
         "  C6 - 8 IN CLAY TILE,     !- Name",
         "  Smooth,                  !- Roughness",
         "  0.2033016,               !- Thickness {m}",
         "  0.5707605,               !- Conductivity {W/m-K}",
         "  1121.292,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.8200000,               !- Solar Absorptance",
         "  0.8200000;               !- Visible Absorptance",
         "Material,",
         "  C10 - 8 IN HW CONCRETE,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.2033016,               !- Thickness {m}",
         "  1.729577,                !- Conductivity {W/m-K}",
         "  2242.585,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.6500000,               !- Solar Absorptance",
         "  0.6500000;               !- Visible Absorptance",
         "Material,",
         "  E2 - 1 / 2 IN SLAG OR STONE,  !- Name",
         "  Rough,                   !- Roughness",
         "  1.2710161E-02,           !- Thickness {m}",
         "  1.435549,                !- Conductivity {W/m-K}",
         "  881.0155,                !- Density {kg/m3}",
         "  1673.600,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.5500000,               !- Solar Absorptance",
         "  0.5500000;               !- Visible Absorptance",
         "Material,",
         "  E3 - 3 / 8 IN FELT AND MEMBRANE,  !- Name",
         "  Rough,                   !- Roughness",
         "  9.5402403E-03,           !- Thickness {m}",
         "  0.1902535,               !- Conductivity {W/m-K}",
         "  1121.292,                !- Density {kg/m3}",
         "  1673.600,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.7500000,               !- Solar Absorptance",
         "  0.7500000;               !- Visible Absorptance",
         "Material,",
         "  B5 - 1 IN DENSE INSULATION,  !- Name",
         "  VeryRough,               !- Roughness",
         "  2.5389841E-02,           !- Thickness {m}",
         "  4.3239430E-02,           !- Conductivity {W/m-K}",
         "  91.30524,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.5000000,               !- Solar Absorptance",
         "  0.5000000;               !- Visible Absorptance",
         "Material,",
         "  C12 - 2 IN HW CONCRETE,  !- Name",
         "  MediumRough,             !- Roughness",
         "  5.0901599E-02,           !- Thickness {m}",
         "  1.729577,                !- Conductivity {W/m-K}",
         "  2242.585,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.6500000,               !- Solar Absorptance",
         "  0.6500000;               !- Visible Absorptance",
         "Material,",
         "  1.375in-Solid-Core,      !- Name",
         "  Smooth,                  !- Roughness",
         "  3.4925E-02,              !- Thickness {m}",
         "  0.1525000,               !- Conductivity {W/m-K}",
         "  614.5000,                !- Density {kg/m3}",
         "  1630.0000,               !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "WindowMaterial:Glazing,",
         "  WIN-LAY-GLASS-LIGHT,     !- Name",
         "  SpectralAverage,         !- Optical Data Type",
         "  ,                        !- Window Glass Spectral Data Set Name",
         "  0.0025,                  !- Thickness {m}",
         "  0.850,                   !- Solar Transmittance at Normal Incidence",
         "  0.075,                   !- Front Side Solar Reflectance at Normal Incidence",
         "  0.075,                   !- Back Side Solar Reflectance at Normal Incidence",
         "  0.901,                   !- Visible Transmittance at Normal Incidence",
         "  0.081,                   !- Front Side Visible Reflectance at Normal Incidence",
         "  0.081,                   !- Back Side Visible Reflectance at Normal Incidence",
         "  0.0,                     !- Infrared Transmittance at Normal Incidence",
         "  0.84,                    !- Front Side Infrared Hemispherical Emissivity",
         "  0.84,                    !- Back Side Infrared Hemispherical Emissivity",
         "  0.9;                     !- Conductivity {W/m-K}",
         "Construction,",
         "  DOOR-CON,                !- Name",
         "  1.375in-Solid-Core;      !- Outside Layer",
         "Construction,",
         "  EXTWALL80,               !- Name",
         "  A1 - 1 IN STUCCO,        !- Outside Layer",
         "  C4 - 4 IN COMMON BRICK,  !- Layer 2",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD;  !- Layer 3",
         "Construction,",
         "  PARTITION06,             !- Name",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD,  !- Outside Layer",
         "  C6 - 8 IN CLAY TILE,     !- Layer 2",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD;  !- Layer 3",
         "  Construction,",
         "  FLOOR SLAB 8 IN,         !- Name",
         "  C10 - 8 IN HW CONCRETE;  !- Outside Layer",
         "Construction,",
         "  ROOF34,                  !- Name",
         "  E2 - 1 / 2 IN SLAG OR STONE,  !- Outside Layer",
         "  E3 - 3 / 8 IN FELT AND MEMBRANE,  !- Layer 2",
         "  B5 - 1 IN DENSE INSULATION,  !- Layer 3",
         "  C12 - 2 IN HW CONCRETE;  !- Layer 4",
         "Construction,",
         "  WIN-CON-LIGHT,           !- Name",
         "  WIN-LAY-GLASS-LIGHT;     !- Outside Layer",
         "Zone,",
         "  WEST_ZONE,               !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "Zone,",
         "  EAST_ZONE,               !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "Zone,",
         "  NORTH_ZONE,              !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "GlobalGeometryRules,",
         "  UpperLeftCorner,         !- Starting Vertex Position",
         "  CounterClockWise,        !- Vertex Entry Direction",
         "  World;                   !- Coordinate System",
         "BuildingSurface:Detailed,",
         "  Surface_1,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,0,3.048000,            !- X,Y,Z ==> Vertex 1 {m}",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_2,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 3 {m}",
         "  0,0,3.048000;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_3,               !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_17,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  0,6.096000,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_4,               !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_10,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_5,               !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_5,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,0,0;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_6,               !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,0,3.048000,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_8,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_9,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_10,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_4,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096001,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_11,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_18,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_12,              !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_12,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,0,0;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_13,              !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,0,3.048000,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_14,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,12.19200,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,12.19200,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  0,6.096000,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_15,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_16,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_17,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_3,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0.000,6.096,3.048,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000,6.096,0.000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096,6.096,0.000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096,6.096,3.048;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_18,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_11,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_19,              !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_19,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,0,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,0;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_20,              !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,3.048000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "AirflowNetwork:SimulationControl,",
         "  NaturalVentilation,      !- Name",
         "  MultizoneWithoutDistribution,  !- AirflowNetwork Control",
         "  SurfaceAverageCalculation,     !- Wind Pressure Coefficient Type",
         "  ExternalNode,            !- Height Selection for Local Wind Pressure Calculation",
         "  LOWRISE,                 !- Building Type",
         "  500,                     !- Maximum Number of Iterations {dimensionless}",
         "  ZeroNodePressures,       !- Initialization Type",
         "  1.0E-05,                 !- Relative Airflow Convergence Tolerance {dimensionless}",
         "  1.0E-06,                 !- Absolute Airflow Convergence Tolerance {kg/s}",
         "  -0.5,                    !- Convergence Acceleration Limit {dimensionless}",
         "  0.0,                     !- Azimuth Angle of Long Axis of Building {deg}",
         "  1.0;                     !- Ratio of Building Width Along Short Axis to Width Along Long Axis",
         "AirflowNetwork:MultiZone:Zone,",
         "  WEST_ZONE,               !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  0.3,                     !- Minimum Venting Open Factor {dimensionless}",
         "  5.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  10.0,                    !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Zone,",
         "  EAST_ZONE,               !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  1.0,                     !- Minimum Venting Open Factor {dimensionless}",
         "  0.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  100.0,                   !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Zone,",
         "  NORTH_ZONE,              !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  1.0,                     !- Minimum Venting Open Factor {dimensionless}",
         "  0.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  100.0,                   !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_1,               !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window/Door Opening Factor, or Crack Factor {dimensionless}",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_4,               !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_11,              !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_15,              !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:ReferenceCrackConditions,",
         "  ReferenceCrackConditions,!- Name",
         "  20.0,                    !- Reference Temperature{ C }",
         "  101320,                  !- Reference Barometric Pressure{ Pa }",
         "  0.005;                   !- Reference Humidity Ratio{ kgWater / kgDryAir }",
         "AirflowNetwork:MultiZone:Surface:Crack,",
         "  CR-1,                    !- Name",
         "  0.01,                    !- Air Mass Flow Coefficient at Reference Conditions{ kg / s }",
         "  0.667,                   !- Air Mass Flow Exponent{ dimensionless }",
         "  ReferenceCrackConditions;!- Reference Crack Conditions",
         "SurfaceConvectionAlgorithm:Inside,TARP;",
         "SurfaceConvectionAlgorithm:Outside,DOE-2;",
         "HeatBalanceAlgorithm,ConductionTransferFunction;",
         "ZoneAirHeatBalanceAlgorithm,",
         "  AnalyticalSolution;      !- Algorithm"});
    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);

    bool errors = false;

    Material::GetMaterialData(*state, errors); // read material data
    EXPECT_FALSE(errors);                      // expect no errors

    HeatBalanceManager::GetConstructData(*state, errors); // read construction data
    EXPECT_FALSE(errors);                                 // expect no errors

    HeatBalanceManager::GetZoneData(*state, errors); // read zone data
    EXPECT_FALSE(errors);                            // expect no errors

    // Magic to get surfaces read in correctly
    state->dataHeatBal->AnyCTF = true;
    state->dataSurfaceGeometry->CosBldgRotAppGonly = 1.0;
    state->dataSurfaceGeometry->SinBldgRotAppGonly = 0.0;

    SurfaceGeometry::GetSurfaceData(*state, errors); // setup zone geometry and get zone data
    EXPECT_FALSE(errors);                            // expect no errors

    EXPECT_EQ(state->dataCurveManager->curves.size(), 1);

    state->afn->get_input();

    EXPECT_EQ(state->dataCurveManager->curves.size(), 6);

    // Check the curves
    Real64 cp105N = -0.5 * (0.44267457181949038 + 0.68051108580039887);
    Real64 cp105S = 0.5 * (0.11880548415819636 - 0.44267457181949038);
    EXPECT_DOUBLE_EQ(0.60345944298105458, Curve::CurveValue(*state, 2, 0));     // In-range value
    EXPECT_DOUBLE_EQ(cp105N, Curve::CurveValue(*state, 2, 105));                // In-range value
    EXPECT_DOUBLE_EQ(0.60345944298105458, Curve::CurveValue(*state, 2, -10.0)); // Minimum x
    EXPECT_DOUBLE_EQ(0.60345944298105458, Curve::CurveValue(*state, 2, 5000));  // Maximum x
    // Check the other curve
    EXPECT_DOUBLE_EQ(0.592, Curve::CurveValue(*state, 1, 0)); // In-range value

    // Check the airflow elements
    EXPECT_EQ(2u, state->afn->MultizoneExternalNodeData.size());
    EXPECT_EQ(3u, state->afn->MultizoneZoneData.size());
    EXPECT_EQ(4u, state->afn->MultizoneSurfaceData.size());
    EXPECT_EQ(1u, state->afn->MultizoneSurfaceCrackData.size());

    EXPECT_EQ(180.0, state->afn->MultizoneExternalNodeData(1).azimuth);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(1).symmetricCurve);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(1).useRelativeAngle);
    EXPECT_EQ(4, state->afn->MultizoneExternalNodeData(1).curve);

    EXPECT_EQ(0.0, state->afn->MultizoneExternalNodeData(2).azimuth);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(2).symmetricCurve);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(2).useRelativeAngle);
    EXPECT_EQ(2, state->afn->MultizoneExternalNodeData(2).curve);

    // Set up some environmental parameters
    state->dataEnvrn->OutBaroPress = 101325.0;
    state->dataEnvrn->OutDryBulbTemp = 25.0;
    state->dataEnvrn->WindDir = 105.0;
    state->dataEnvrn->OutHumRat = 0.0;        // Dry air only
    state->dataEnvrn->SiteTempGradient = 0.0; // Disconnect z from testing
    state->dataEnvrn->SiteWindExp = 0.0;      // Disconnect variation by height
    state->dataEnvrn->WindSpeed = 10.0;

    // Make sure we can compute the right wind pressure
    Real64 rho =
        Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, state->dataEnvrn->OutDryBulbTemp, state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(1.1841123742118911, rho);
    Real64 p = state->afn->calculate_wind_pressure(state->afn->MultizoneExternalNodeData(2).curve,
                                                   false,
                                                   false,
                                                   0.0,
                                                   1.0,
                                                   state->dataEnvrn->WindDir,
                                                   DataEnvironment::OutDryBulbTempAt(*state, 10.0),
                                                   state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(cp105N * 0.5 * 1.1841123742118911, p);
    p = state->afn->calculate_wind_pressure(state->afn->MultizoneExternalNodeData(1).curve,
                                            false,
                                            false,
                                            0.0,
                                            1.0,
                                            state->dataEnvrn->WindDir,
                                            DataEnvironment::OutDryBulbTempAt(*state, 10.0),
                                            state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(cp105S * 0.5 * 1.1841123742118911, p);

    // Make sure the reference velocity comes out right
    EXPECT_DOUBLE_EQ(10.0, DataEnvironment::WindSpeedAt(*state, state->afn->MultizoneExternalNodeData(1).height));

    EXPECT_EQ(5u, state->afn->AirflowNetworkNodeSimu.size());

    // Run the balance routine, for now only to get the pressure set at the external nodes
    state->afn->calculate_balance();

    EXPECT_DOUBLE_EQ(cp105N * 0.5 * 118.41123742118911, state->afn->AirflowNetworkNodeSimu(5).PZ);
    EXPECT_DOUBLE_EQ(cp105S * 0.5 * 118.41123742118911, state->afn->AirflowNetworkNodeSimu(4).PZ);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_TestExternalNodesWithSymmetricTable)
{
    std::string const idf_objects = delimited_string(
        {"Material,",
         "  A1 - 1 IN STUCCO,        !- Name",
         "  Smooth,                  !- Roughness",
         "  2.5389841E-02,           !- Thickness {m}",
         "  0.6918309,               !- Conductivity {W/m-K}",
         "  1858.142,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "Material,",
         "  C4 - 4 IN COMMON BRICK,  !- Name",
         "  Rough,                   !- Roughness",
         "  0.1014984,               !- Thickness {m}",
         "  0.7264224,               !- Conductivity {W/m-K}",
         "  1922.216,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.7600000,               !- Solar Absorptance",
         "  0.7600000;               !- Visible Absorptance",
         "Material,",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD,  !- Name",
         "  Smooth,                  !- Roughness",
         "  1.905E-02,               !- Thickness {m}",
         "  0.7264224,               !- Conductivity {W/m-K}",
         "  1601.846,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "Material,",
         "  C6 - 8 IN CLAY TILE,     !- Name",
         "  Smooth,                  !- Roughness",
         "  0.2033016,               !- Thickness {m}",
         "  0.5707605,               !- Conductivity {W/m-K}",
         "  1121.292,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.8200000,               !- Solar Absorptance",
         "  0.8200000;               !- Visible Absorptance",
         "Material,",
         "  C10 - 8 IN HW CONCRETE,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.2033016,               !- Thickness {m}",
         "  1.729577,                !- Conductivity {W/m-K}",
         "  2242.585,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.6500000,               !- Solar Absorptance",
         "  0.6500000;               !- Visible Absorptance",
         "Material,",
         "  E2 - 1 / 2 IN SLAG OR STONE,  !- Name",
         "  Rough,                   !- Roughness",
         "  1.2710161E-02,           !- Thickness {m}",
         "  1.435549,                !- Conductivity {W/m-K}",
         "  881.0155,                !- Density {kg/m3}",
         "  1673.600,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.5500000,               !- Solar Absorptance",
         "  0.5500000;               !- Visible Absorptance",
         "Material,",
         "  E3 - 3 / 8 IN FELT AND MEMBRANE,  !- Name",
         "  Rough,                   !- Roughness",
         "  9.5402403E-03,           !- Thickness {m}",
         "  0.1902535,               !- Conductivity {W/m-K}",
         "  1121.292,                !- Density {kg/m3}",
         "  1673.600,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.7500000,               !- Solar Absorptance",
         "  0.7500000;               !- Visible Absorptance",
         "Material,",
         "  B5 - 1 IN DENSE INSULATION,  !- Name",
         "  VeryRough,               !- Roughness",
         "  2.5389841E-02,           !- Thickness {m}",
         "  4.3239430E-02,           !- Conductivity {W/m-K}",
         "  91.30524,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.5000000,               !- Solar Absorptance",
         "  0.5000000;               !- Visible Absorptance",
         "Material,",
         "  C12 - 2 IN HW CONCRETE,  !- Name",
         "  MediumRough,             !- Roughness",
         "  5.0901599E-02,           !- Thickness {m}",
         "  1.729577,                !- Conductivity {W/m-K}",
         "  2242.585,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.6500000,               !- Solar Absorptance",
         "  0.6500000;               !- Visible Absorptance",
         "Material,",
         "  1.375in-Solid-Core,      !- Name",
         "  Smooth,                  !- Roughness",
         "  3.4925E-02,              !- Thickness {m}",
         "  0.1525000,               !- Conductivity {W/m-K}",
         "  614.5000,                !- Density {kg/m3}",
         "  1630.0000,               !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "WindowMaterial:Glazing,",
         "  WIN-LAY-GLASS-LIGHT,     !- Name",
         "  SpectralAverage,         !- Optical Data Type",
         "  ,                        !- Window Glass Spectral Data Set Name",
         "  0.0025,                  !- Thickness {m}",
         "  0.850,                   !- Solar Transmittance at Normal Incidence",
         "  0.075,                   !- Front Side Solar Reflectance at Normal Incidence",
         "  0.075,                   !- Back Side Solar Reflectance at Normal Incidence",
         "  0.901,                   !- Visible Transmittance at Normal Incidence",
         "  0.081,                   !- Front Side Visible Reflectance at Normal Incidence",
         "  0.081,                   !- Back Side Visible Reflectance at Normal Incidence",
         "  0.0,                     !- Infrared Transmittance at Normal Incidence",
         "  0.84,                    !- Front Side Infrared Hemispherical Emissivity",
         "  0.84,                    !- Back Side Infrared Hemispherical Emissivity",
         "  0.9;                     !- Conductivity {W/m-K}",
         "Construction,",
         "  DOOR-CON,                !- Name",
         "  1.375in-Solid-Core;      !- Outside Layer",
         "Construction,",
         "  EXTWALL80,               !- Name",
         "  A1 - 1 IN STUCCO,        !- Outside Layer",
         "  C4 - 4 IN COMMON BRICK,  !- Layer 2",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD;  !- Layer 3",
         "Construction,",
         "  PARTITION06,             !- Name",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD,  !- Outside Layer",
         "  C6 - 8 IN CLAY TILE,     !- Layer 2",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD;  !- Layer 3",
         "  Construction,",
         "  FLOOR SLAB 8 IN,         !- Name",
         "  C10 - 8 IN HW CONCRETE;  !- Outside Layer",
         "Construction,",
         "  ROOF34,                  !- Name",
         "  E2 - 1 / 2 IN SLAG OR STONE,  !- Outside Layer",
         "  E3 - 3 / 8 IN FELT AND MEMBRANE,  !- Layer 2",
         "  B5 - 1 IN DENSE INSULATION,  !- Layer 3",
         "  C12 - 2 IN HW CONCRETE;  !- Layer 4",
         "Construction,",
         "  WIN-CON-LIGHT,           !- Name",
         "  WIN-LAY-GLASS-LIGHT;     !- Outside Layer",
         "Zone,",
         "  WEST_ZONE,               !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "Zone,",
         "  EAST_ZONE,               !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "Zone,",
         "  NORTH_ZONE,              !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "GlobalGeometryRules,",
         "  UpperLeftCorner,         !- Starting Vertex Position",
         "  CounterClockWise,        !- Vertex Entry Direction",
         "  World;                   !- Coordinate System",
         "BuildingSurface:Detailed,",
         "  Surface_1,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,0,3.048000,            !- X,Y,Z ==> Vertex 1 {m}",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_2,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 3 {m}",
         "  0,0,3.048000;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_3,               !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_17,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  0,6.096000,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_4,               !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_10,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_5,               !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_5,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,0,0;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_6,               !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,0,3.048000,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_8,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_9,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_10,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_4,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096001,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_11,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_18,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_12,              !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_12,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,0,0;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_13,              !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,0,3.048000,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_14,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,12.19200,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,12.19200,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  0,6.096000,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_15,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_16,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_17,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_3,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0.000,6.096,3.048,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000,6.096,0.000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096,6.096,0.000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096,6.096,3.048;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_18,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_11,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_19,              !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_19,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,0,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,0;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_20,              !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,3.048000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "AirflowNetwork:SimulationControl,",
         "  NaturalVentilation,      !- Name",
         "  MultizoneWithoutDistribution,  !- AirflowNetwork Control",
         "  INPUT,                   !- Wind Pressure Coefficient Type",
         "  ExternalNode,            !- Height Selection for Local Wind Pressure Calculation",
         "  LOWRISE,                 !- Building Type",
         "  500,                     !- Maximum Number of Iterations {dimensionless}",
         "  ZeroNodePressures,       !- Initialization Type",
         "  1.0E-05,                 !- Relative Airflow Convergence Tolerance {dimensionless}",
         "  1.0E-06,                 !- Absolute Airflow Convergence Tolerance {kg/s}",
         "  -0.5,                    !- Convergence Acceleration Limit {dimensionless}",
         "  0.0,                     !- Azimuth Angle of Long Axis of Building {deg}",
         "  1.0;                     !- Ratio of Building Width Along Short Axis to Width Along Long Axis",
         "AirflowNetwork:MultiZone:Zone,",
         "  WEST_ZONE,               !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         //"  Temperature,             !- Ventilation Control Mode",
         //"  WindowVentSched,         !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  0.3,                     !- Minimum Venting Open Factor {dimensionless}",
         "  5.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  10.0,                    !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Zone,",
         "  EAST_ZONE,               !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  1.0,                     !- Minimum Venting Open Factor {dimensionless}",
         "  0.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  100.0,                   !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Zone,",
         "  NORTH_ZONE,              !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         //"  Temperature,             !- Ventilation Control Mode",
         //"  WindowVentSched,         !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  1.0,                     !- Minimum Venting Open Factor {dimensionless}",
         "  0.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  100.0,                   !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_1,               !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  SFacade,                 !- External Node Name",
         "  1.0;                     !- Window/Door Opening Factor, or Crack Factor {dimensionless}",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_4,               !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_11,              !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_15,              !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  NFacade,                 !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:ExternalNode,",
         "  NFacade,                 !- Name",
         "  1.524,                   !- External Node Height{ m }",
         "  NFacade_WPCCurve,        !- Wind Pressure Coefficient Values Object Name",
         "  Yes;                     !- Symmetric Wind Pressure Coefficient Curve",
         "AirflowNetwork:MultiZone:ExternalNode,",
         "  SFacade,                 !- Name",
         "  1.524,                   !- External Node Height{ m }",
         "  NFacade_WPCCurve,        !- Wind Pressure Coefficient Values Object Name",
         "  Yes,                     !- Symmetric Wind Pressure Coefficient Curve",
         "  Relative;                !- Wind Angle Type",
         "AirflowNetwork:MultiZone:ReferenceCrackConditions,",
         "  ReferenceCrackConditions,!- Name",
         "  20.0,                    !- Reference Temperature{ C }",
         "  101320,                  !- Reference Barometric Pressure{ Pa }",
         "  0.005;                   !- Reference Humidity Ratio{ kgWater / kgDryAir }",
         "AirflowNetwork:MultiZone:Surface:Crack,",
         "  CR-1,                    !- Name",
         "  0.01,                    !- Air Mass Flow Coefficient at Reference Conditions{ kg / s }",
         "  0.667,                   !- Air Mass Flow Exponent{ dimensionless }",
         "  ReferenceCrackConditions;!- Reference Crack Conditions",

         "Table:IndependentVariable,",
         "  Wind_Direction_30_deg,     !- Name",
         "  Linear,                    !- Interpolation Method",
         "  Constant,                  !- Extrapolation Method",
         "  0,                         !- Minimum Value",
         "  180,                       !- Maximum Value",
         "  ,                          !- Normalization Reference Value",
         "  Dimensionless,             !- Unit Type",
         "  ,                          !- External File Name",
         "  ,                          !- External File Column Number",
         "  ,                          !- External File Starting Row Number",
         "  0,                         !- Value 1",
         "  30,",
         "  60,",
         "  90,",
         "  120,",
         "  150,",
         "  180;",

         "Table:IndependentVariableList,",
         "  Wind_Pressure_Variables,   !- Name",
         "  Wind_Direction_30_deg;     !- Independent Variable 1 Name",

         "Table:Lookup,",
         "  NFacade_WPCCurve,          !- Name",
         "  Wind_Pressure_Variables,   !- Independent Variable List Name",
         "  ,                          !- Normalization Method",
         "  ,                          !- Normalization Divisor",
         "  -1,                        !- Minimum Output",
         "  1,                         !- Maximum Output",
         "  Dimensionless,             !- Output Unit Type",
         "  ,                          !- External File Name",
         "  ,                          !- External File Column Number",
         "  ,                          !- External File Starting Row Number",
         "  0.60,                      !- Output Value 1",
         "  0.48,",
         "  0.04,",
         "  -0.56,",
         "  -0.56,",
         "  -0.42,",
         "  -0.37;",

         "SurfaceConvectionAlgorithm:Inside,TARP;",
         "SurfaceConvectionAlgorithm:Outside,DOE-2;",
         "HeatBalanceAlgorithm,ConductionTransferFunction;",
         "ZoneAirHeatBalanceAlgorithm,",
         "  AnalyticalSolution;      !- Algorithm"});
    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);

    bool errors = false;

    Material::GetMaterialData(*state, errors); // read material data
    EXPECT_FALSE(errors);                      // expect no errors

    HeatBalanceManager::GetConstructData(*state, errors); // read construction data
    EXPECT_FALSE(errors);                                 // expect no errors

    HeatBalanceManager::GetZoneData(*state, errors); // read zone data
    EXPECT_FALSE(errors);                            // expect no errors

    // Magic to get surfaces read in correctly
    state->dataHeatBal->AnyCTF = true;
    state->dataSurfaceGeometry->CosBldgRotAppGonly = 1.0;
    state->dataSurfaceGeometry->SinBldgRotAppGonly = 0.0;

    SurfaceGeometry::GetSurfaceData(*state, errors); // setup zone geometry and get zone data
    EXPECT_FALSE(errors);                            // expect no errors

    EXPECT_EQ(state->dataCurveManager->curves.size(), 1);

    state->afn->get_input();

    // Check the airflow elements
    EXPECT_EQ(2u, state->afn->MultizoneExternalNodeData.size());
    EXPECT_EQ(3u, state->afn->MultizoneZoneData.size());
    EXPECT_EQ(4u, state->afn->MultizoneSurfaceData.size());
    EXPECT_EQ(1u, state->afn->MultizoneSurfaceCrackData.size());

    EXPECT_EQ(0.0, state->afn->MultizoneExternalNodeData(1).azimuth);
    EXPECT_TRUE(state->afn->MultizoneExternalNodeData(1).symmetricCurve);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(1).useRelativeAngle);
    EXPECT_EQ(1, state->afn->MultizoneExternalNodeData(1).curve);

    EXPECT_EQ(180.0, state->afn->MultizoneExternalNodeData(2).azimuth);
    EXPECT_TRUE(state->afn->MultizoneExternalNodeData(2).symmetricCurve);
    EXPECT_TRUE(state->afn->MultizoneExternalNodeData(2).useRelativeAngle);
    EXPECT_EQ(1, state->afn->MultizoneExternalNodeData(2).curve);

    // Set up some environmental parameters
    state->dataEnvrn->OutBaroPress = 101325.0;
    state->dataEnvrn->OutDryBulbTemp = 25.0;
    state->dataEnvrn->WindDir = 105.0;
    state->dataEnvrn->OutHumRat = 0.0;        // Dry air only
    state->dataEnvrn->SiteTempGradient = 0.0; // Disconnect z from testing
    state->dataEnvrn->SiteWindExp = 0.0;      // Disconnect variation by height
    state->dataEnvrn->WindSpeed = 10.0;

    // Make sure we can compute the right wind pressure
    Real64 rho =
        Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, state->dataEnvrn->OutDryBulbTemp, state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(1.1841123742118911, rho);
    Real64 p = state->afn->calculate_wind_pressure(state->afn->MultizoneExternalNodeData(1).curve,
                                                   false,
                                                   false,
                                                   0.0,
                                                   1.0,
                                                   state->dataEnvrn->WindDir,
                                                   DataEnvironment::OutDryBulbTempAt(*state, 10.0),
                                                   state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(-0.56 * 0.5 * 1.1841123742118911, p);

    // Make sure the reference velocity comes out right
    EXPECT_DOUBLE_EQ(10.0, DataEnvironment::WindSpeedAt(*state, state->afn->MultizoneExternalNodeData(1).height));

    EXPECT_EQ(5u, state->afn->AirflowNetworkNodeSimu.size());

    // Run the balance routine, for now only to get the pressure set at the external nodes
    state->afn->calculate_balance();

    EXPECT_DOUBLE_EQ(-0.56 * 0.5 * 118.41123742118911, state->afn->AirflowNetworkNodeSimu(4).PZ);
    EXPECT_DOUBLE_EQ(-0.26 * 0.5 * 118.41123742118911, state->afn->AirflowNetworkNodeSimu(5).PZ);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_TestExternalNodesWithSymmetricCurve)
{
    std::string const idf_objects = delimited_string(
        {"Curve:Quartic,",
         "  WindPressureFit,         !- Name",
         "  0.592,                   !- Coefficient1 Constant",
         "  0.0148,                  !- Coefficient2 x",
         "  -.000757,                !- Coefficient3 x**2",
         "  0.00000662,              !- Coefficient4 x**3",
         "  -.0000000169,            !- Coefficient5 x**4",
         "  0,                       !- Minimum Value of x",
         "  180,                     !- Maximum Value of x",
         "  -1,                      !- Minimum Curve Output",
         "  1,                       !- Maximum Curve Output",
         "  Dimensionless,           !- Input Unit Type for X",
         "  Dimensionless;           !- Output Unit Type",
         "Material,",
         "  A1 - 1 IN STUCCO,        !- Name",
         "  Smooth,                  !- Roughness",
         "  2.5389841E-02,           !- Thickness {m}",
         "  0.6918309,               !- Conductivity {W/m-K}",
         "  1858.142,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "Material,",
         "  C4 - 4 IN COMMON BRICK,  !- Name",
         "  Rough,                   !- Roughness",
         "  0.1014984,               !- Thickness {m}",
         "  0.7264224,               !- Conductivity {W/m-K}",
         "  1922.216,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.7600000,               !- Solar Absorptance",
         "  0.7600000;               !- Visible Absorptance",
         "Material,",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD,  !- Name",
         "  Smooth,                  !- Roughness",
         "  1.905E-02,               !- Thickness {m}",
         "  0.7264224,               !- Conductivity {W/m-K}",
         "  1601.846,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "Material,",
         "  C6 - 8 IN CLAY TILE,     !- Name",
         "  Smooth,                  !- Roughness",
         "  0.2033016,               !- Thickness {m}",
         "  0.5707605,               !- Conductivity {W/m-K}",
         "  1121.292,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.8200000,               !- Solar Absorptance",
         "  0.8200000;               !- Visible Absorptance",
         "Material,",
         "  C10 - 8 IN HW CONCRETE,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.2033016,               !- Thickness {m}",
         "  1.729577,                !- Conductivity {W/m-K}",
         "  2242.585,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.6500000,               !- Solar Absorptance",
         "  0.6500000;               !- Visible Absorptance",
         "Material,",
         "  E2 - 1 / 2 IN SLAG OR STONE,  !- Name",
         "  Rough,                   !- Roughness",
         "  1.2710161E-02,           !- Thickness {m}",
         "  1.435549,                !- Conductivity {W/m-K}",
         "  881.0155,                !- Density {kg/m3}",
         "  1673.600,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.5500000,               !- Solar Absorptance",
         "  0.5500000;               !- Visible Absorptance",
         "Material,",
         "  E3 - 3 / 8 IN FELT AND MEMBRANE,  !- Name",
         "  Rough,                   !- Roughness",
         "  9.5402403E-03,           !- Thickness {m}",
         "  0.1902535,               !- Conductivity {W/m-K}",
         "  1121.292,                !- Density {kg/m3}",
         "  1673.600,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.7500000,               !- Solar Absorptance",
         "  0.7500000;               !- Visible Absorptance",
         "Material,",
         "  B5 - 1 IN DENSE INSULATION,  !- Name",
         "  VeryRough,               !- Roughness",
         "  2.5389841E-02,           !- Thickness {m}",
         "  4.3239430E-02,           !- Conductivity {W/m-K}",
         "  91.30524,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.5000000,               !- Solar Absorptance",
         "  0.5000000;               !- Visible Absorptance",
         "Material,",
         "  C12 - 2 IN HW CONCRETE,  !- Name",
         "  MediumRough,             !- Roughness",
         "  5.0901599E-02,           !- Thickness {m}",
         "  1.729577,                !- Conductivity {W/m-K}",
         "  2242.585,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.6500000,               !- Solar Absorptance",
         "  0.6500000;               !- Visible Absorptance",
         "Material,",
         "  1.375in-Solid-Core,      !- Name",
         "  Smooth,                  !- Roughness",
         "  3.4925E-02,              !- Thickness {m}",
         "  0.1525000,               !- Conductivity {W/m-K}",
         "  614.5000,                !- Density {kg/m3}",
         "  1630.0000,               !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "WindowMaterial:Glazing,",
         "  WIN-LAY-GLASS-LIGHT,     !- Name",
         "  SpectralAverage,         !- Optical Data Type",
         "  ,                        !- Window Glass Spectral Data Set Name",
         "  0.0025,                  !- Thickness {m}",
         "  0.850,                   !- Solar Transmittance at Normal Incidence",
         "  0.075,                   !- Front Side Solar Reflectance at Normal Incidence",
         "  0.075,                   !- Back Side Solar Reflectance at Normal Incidence",
         "  0.901,                   !- Visible Transmittance at Normal Incidence",
         "  0.081,                   !- Front Side Visible Reflectance at Normal Incidence",
         "  0.081,                   !- Back Side Visible Reflectance at Normal Incidence",
         "  0.0,                     !- Infrared Transmittance at Normal Incidence",
         "  0.84,                    !- Front Side Infrared Hemispherical Emissivity",
         "  0.84,                    !- Back Side Infrared Hemispherical Emissivity",
         "  0.9;                     !- Conductivity {W/m-K}",
         "Construction,",
         "  DOOR-CON,                !- Name",
         "  1.375in-Solid-Core;      !- Outside Layer",
         "Construction,",
         "  EXTWALL80,               !- Name",
         "  A1 - 1 IN STUCCO,        !- Outside Layer",
         "  C4 - 4 IN COMMON BRICK,  !- Layer 2",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD;  !- Layer 3",
         "Construction,",
         "  PARTITION06,             !- Name",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD,  !- Outside Layer",
         "  C6 - 8 IN CLAY TILE,     !- Layer 2",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD;  !- Layer 3",
         "  Construction,",
         "  FLOOR SLAB 8 IN,         !- Name",
         "  C10 - 8 IN HW CONCRETE;  !- Outside Layer",
         "Construction,",
         "  ROOF34,                  !- Name",
         "  E2 - 1 / 2 IN SLAG OR STONE,  !- Outside Layer",
         "  E3 - 3 / 8 IN FELT AND MEMBRANE,  !- Layer 2",
         "  B5 - 1 IN DENSE INSULATION,  !- Layer 3",
         "  C12 - 2 IN HW CONCRETE;  !- Layer 4",
         "Construction,",
         "  WIN-CON-LIGHT,           !- Name",
         "  WIN-LAY-GLASS-LIGHT;     !- Outside Layer",
         "Zone,",
         "  WEST_ZONE,               !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "Zone,",
         "  EAST_ZONE,               !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "Zone,",
         "  NORTH_ZONE,              !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "GlobalGeometryRules,",
         "  UpperLeftCorner,         !- Starting Vertex Position",
         "  CounterClockWise,        !- Vertex Entry Direction",
         "  World;                   !- Coordinate System",
         "BuildingSurface:Detailed,",
         "  Surface_1,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,0,3.048000,            !- X,Y,Z ==> Vertex 1 {m}",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_2,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 3 {m}",
         "  0,0,3.048000;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_3,               !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_17,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  0,6.096000,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_4,               !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_10,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_5,               !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_5,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,0,0;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_6,               !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,0,3.048000,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_8,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_9,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_10,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_4,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096001,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_11,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_18,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_12,              !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_12,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,0,0;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_13,              !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,0,3.048000,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_14,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,12.19200,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,12.19200,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  0,6.096000,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_15,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_16,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_17,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_3,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0.000,6.096,3.048,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000,6.096,0.000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096,6.096,0.000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096,6.096,3.048;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_18,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_11,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_19,              !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_19,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,0,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,0;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_20,              !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,3.048000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "AirflowNetwork:SimulationControl,",
         "  NaturalVentilation,      !- Name",
         "  MultizoneWithoutDistribution,  !- AirflowNetwork Control",
         "  INPUT,                   !- Wind Pressure Coefficient Type",
         "  ExternalNode,            !- Height Selection for Local Wind Pressure Calculation",
         "  LOWRISE,                 !- Building Type",
         "  500,                     !- Maximum Number of Iterations {dimensionless}",
         "  ZeroNodePressures,       !- Initialization Type",
         "  1.0E-05,                 !- Relative Airflow Convergence Tolerance {dimensionless}",
         "  1.0E-06,                 !- Absolute Airflow Convergence Tolerance {kg/s}",
         "  -0.5,                    !- Convergence Acceleration Limit {dimensionless}",
         "  0.0,                     !- Azimuth Angle of Long Axis of Building {deg}",
         "  1.0;                     !- Ratio of Building Width Along Short Axis to Width Along Long Axis",
         "AirflowNetwork:MultiZone:Zone,",
         "  WEST_ZONE,               !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  0.3,                     !- Minimum Venting Open Factor {dimensionless}",
         "  5.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  10.0,                    !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Zone,",
         "  EAST_ZONE,               !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  1.0,                     !- Minimum Venting Open Factor {dimensionless}",
         "  0.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  100.0,                   !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Zone,",
         "  NORTH_ZONE,              !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  1.0,                     !- Minimum Venting Open Factor {dimensionless}",
         "  0.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  100.0,                   !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_1,               !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  SFacade,                 !- External Node Name",
         "  1.0;                     !- Window/Door Opening Factor, or Crack Factor {dimensionless}",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_4,               !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_11,              !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_15,              !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  NFacade,                 !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:ExternalNode,",
         "  NFacade,                 !- Name",
         "  1.524,                   !- External Node Height{ m }",
         "  WindPressureFit,         !- Wind Pressure Coefficient Values Object Name",
         "  Yes;                     !- Symmetric Wind Pressure Coefficient Curve",
         "AirflowNetwork:MultiZone:ExternalNode,",
         "  SFacade,                 !- Name",
         "  1.524,                   !- External Node Height{ m }",
         "  WindPressureFit,         !- Wind Pressure Coefficient Values Object Name",
         "  Yes,                     !- Symmetric Wind Pressure Coefficient Curve",
         "  Relative;                !- Wind Angle Type",
         "AirflowNetwork:MultiZone:ReferenceCrackConditions,",
         "  ReferenceCrackConditions,!- Name",
         "  20.0,                    !- Reference Temperature{ C }",
         "  101320,                  !- Reference Barometric Pressure{ Pa }",
         "  0.005;                   !- Reference Humidity Ratio{ kgWater / kgDryAir }",
         "AirflowNetwork:MultiZone:Surface:Crack,",
         "  CR-1,                    !- Name",
         "  0.01,                    !- Air Mass Flow Coefficient at Reference Conditions{ kg / s }",
         "  0.667,                   !- Air Mass Flow Exponent{ dimensionless }",
         "  ReferenceCrackConditions;!- Reference Crack Conditions",
         "SurfaceConvectionAlgorithm:Inside,TARP;",
         "SurfaceConvectionAlgorithm:Outside,DOE-2;",
         "HeatBalanceAlgorithm,ConductionTransferFunction;",
         "ZoneAirHeatBalanceAlgorithm,",
         "  AnalyticalSolution;      !- Algorithm"});
    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);

    bool errors = false;

    Material::GetMaterialData(*state, errors); // read material data
    EXPECT_FALSE(errors);                      // expect no errors

    HeatBalanceManager::GetConstructData(*state, errors); // read construction data
    EXPECT_FALSE(errors);                                 // expect no errors

    HeatBalanceManager::GetZoneData(*state, errors); // read zone data
    EXPECT_FALSE(errors);                            // expect no errors

    // Magic to get surfaces read in correctly
    state->dataHeatBal->AnyCTF = true;
    state->dataSurfaceGeometry->CosBldgRotAppGonly = 1.0;
    state->dataSurfaceGeometry->SinBldgRotAppGonly = 0.0;

    SurfaceGeometry::GetSurfaceData(*state, errors); // setup zone geometry and get zone data
    EXPECT_FALSE(errors);                            // expect no errors

    EXPECT_EQ(state->dataCurveManager->curves.size(), 1);

    state->afn->get_input();

    // Check the airflow elements
    EXPECT_EQ(2u, state->afn->MultizoneExternalNodeData.size());
    EXPECT_EQ(3u, state->afn->MultizoneZoneData.size());
    EXPECT_EQ(4u, state->afn->MultizoneSurfaceData.size());
    EXPECT_EQ(1u, state->afn->MultizoneSurfaceCrackData.size());

    EXPECT_EQ(0.0, state->afn->MultizoneExternalNodeData(1).azimuth);
    EXPECT_TRUE(state->afn->MultizoneExternalNodeData(1).symmetricCurve);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(1).useRelativeAngle);
    EXPECT_EQ(1, state->afn->MultizoneExternalNodeData(1).curve);

    EXPECT_EQ(180.0, state->afn->MultizoneExternalNodeData(2).azimuth);
    EXPECT_TRUE(state->afn->MultizoneExternalNodeData(2).symmetricCurve);
    EXPECT_TRUE(state->afn->MultizoneExternalNodeData(2).useRelativeAngle);
    EXPECT_EQ(1, state->afn->MultizoneExternalNodeData(2).curve);

    // Check the curves
    Real64 cp105N = -0.590653062499999;
    Real64 cp105S = -0.298039062499999;
    EXPECT_DOUBLE_EQ(0.592, Curve::CurveValue(*state, 1, 0));                   // In-range value
    EXPECT_NEAR(cp105N, Curve::CurveValue(*state, 1, 105), 1e-14);              // In-range value
    EXPECT_NEAR(cp105S, Curve::CurveValue(*state, 1, 75), 1e-14);               // In-range value
    EXPECT_DOUBLE_EQ(0.592, Curve::CurveValue(*state, 1, -10.0));               // Minimum x
    EXPECT_NEAR(-0.403903999999994, Curve::CurveValue(*state, 1, 5000), 1e-14); // Maximum x

    // Set up some environmental parameters
    state->dataEnvrn->OutBaroPress = 101325.0;
    state->dataEnvrn->OutDryBulbTemp = 25.0;
    state->dataEnvrn->WindDir = 105.0;
    state->dataEnvrn->OutHumRat = 0.0;        // Dry air only
    state->dataEnvrn->SiteTempGradient = 0.0; // Disconnect z from testing
    state->dataEnvrn->SiteWindExp = 0.0;      // Disconnect variation by height
    state->dataEnvrn->WindSpeed = 10.0;

    // Make sure we can compute the right wind pressure
    Real64 rho =
        Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, state->dataEnvrn->OutDryBulbTemp, state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(1.1841123742118911, rho);
    Real64 p = state->afn->calculate_wind_pressure(state->afn->MultizoneExternalNodeData(1).curve,
                                                   false,
                                                   false,
                                                   0.0,
                                                   1.0,
                                                   state->dataEnvrn->WindDir,
                                                   DataEnvironment::OutDryBulbTempAt(*state, 10.0),
                                                   state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(cp105N * 0.5 * 1.1841123742118911, p);

    // Make sure the reference velocity comes out right
    EXPECT_DOUBLE_EQ(10.0, DataEnvironment::WindSpeedAt(*state, state->afn->MultizoneExternalNodeData(1).height));

    EXPECT_EQ(5u, state->afn->AirflowNetworkNodeSimu.size());

    // Run the balance routine, for now only to get the pressure set at the external nodes
    state->afn->calculate_balance();

    EXPECT_NEAR(cp105N * 0.5 * 118.41123742118911, state->afn->AirflowNetworkNodeSimu(4).PZ, 1e-13);
    EXPECT_NEAR(cp105S * 0.5 * 118.41123742118911, state->afn->AirflowNetworkNodeSimu(5).PZ, 1e-13);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_TestExternalNodesWithLocalAirNode)
{
    std::string const idf_objects = delimited_string(
        {"Material,",
         "  A1 - 1 IN STUCCO,        !- Name",
         "  Smooth,                  !- Roughness",
         "  2.5389841E-02,           !- Thickness {m}",
         "  0.6918309,               !- Conductivity {W/m-K}",
         "  1858.142,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "Material,",
         "  C4 - 4 IN COMMON BRICK,  !- Name",
         "  Rough,                   !- Roughness",
         "  0.1014984,               !- Thickness {m}",
         "  0.7264224,               !- Conductivity {W/m-K}",
         "  1922.216,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.7600000,               !- Solar Absorptance",
         "  0.7600000;               !- Visible Absorptance",
         "Material,",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD,  !- Name",
         "  Smooth,                  !- Roughness",
         "  1.905E-02,               !- Thickness {m}",
         "  0.7264224,               !- Conductivity {W/m-K}",
         "  1601.846,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "Material,",
         "  C6 - 8 IN CLAY TILE,     !- Name",
         "  Smooth,                  !- Roughness",
         "  0.2033016,               !- Thickness {m}",
         "  0.5707605,               !- Conductivity {W/m-K}",
         "  1121.292,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.8200000,               !- Solar Absorptance",
         "  0.8200000;               !- Visible Absorptance",
         "Material,",
         "  C10 - 8 IN HW CONCRETE,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.2033016,               !- Thickness {m}",
         "  1.729577,                !- Conductivity {W/m-K}",
         "  2242.585,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.6500000,               !- Solar Absorptance",
         "  0.6500000;               !- Visible Absorptance",
         "Material,",
         "  E2 - 1 / 2 IN SLAG OR STONE,  !- Name",
         "  Rough,                   !- Roughness",
         "  1.2710161E-02,           !- Thickness {m}",
         "  1.435549,                !- Conductivity {W/m-K}",
         "  881.0155,                !- Density {kg/m3}",
         "  1673.600,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.5500000,               !- Solar Absorptance",
         "  0.5500000;               !- Visible Absorptance",
         "Material,",
         "  E3 - 3 / 8 IN FELT AND MEMBRANE,  !- Name",
         "  Rough,                   !- Roughness",
         "  9.5402403E-03,           !- Thickness {m}",
         "  0.1902535,               !- Conductivity {W/m-K}",
         "  1121.292,                !- Density {kg/m3}",
         "  1673.600,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.7500000,               !- Solar Absorptance",
         "  0.7500000;               !- Visible Absorptance",
         "Material,",
         "  B5 - 1 IN DENSE INSULATION,  !- Name",
         "  VeryRough,               !- Roughness",
         "  2.5389841E-02,           !- Thickness {m}",
         "  4.3239430E-02,           !- Conductivity {W/m-K}",
         "  91.30524,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.5000000,               !- Solar Absorptance",
         "  0.5000000;               !- Visible Absorptance",
         "Material,",
         "  C12 - 2 IN HW CONCRETE,  !- Name",
         "  MediumRough,             !- Roughness",
         "  5.0901599E-02,           !- Thickness {m}",
         "  1.729577,                !- Conductivity {W/m-K}",
         "  2242.585,                !- Density {kg/m3}",
         "  836.8000,                !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.6500000,               !- Solar Absorptance",
         "  0.6500000;               !- Visible Absorptance",
         "Material,",
         "  1.375in-Solid-Core,      !- Name",
         "  Smooth,                  !- Roughness",
         "  3.4925E-02,              !- Thickness {m}",
         "  0.1525000,               !- Conductivity {W/m-K}",
         "  614.5000,                !- Density {kg/m3}",
         "  1630.0000,               !- Specific Heat {J/kg-K}",
         "  0.9000000,               !- Thermal Absorptance",
         "  0.9200000,               !- Solar Absorptance",
         "  0.9200000;               !- Visible Absorptance",
         "WindowMaterial:Glazing,",
         "  WIN-LAY-GLASS-LIGHT,     !- Name",
         "  SpectralAverage,         !- Optical Data Type",
         "  ,                        !- Window Glass Spectral Data Set Name",
         "  0.0025,                  !- Thickness {m}",
         "  0.850,                   !- Solar Transmittance at Normal Incidence",
         "  0.075,                   !- Front Side Solar Reflectance at Normal Incidence",
         "  0.075,                   !- Back Side Solar Reflectance at Normal Incidence",
         "  0.901,                   !- Visible Transmittance at Normal Incidence",
         "  0.081,                   !- Front Side Visible Reflectance at Normal Incidence",
         "  0.081,                   !- Back Side Visible Reflectance at Normal Incidence",
         "  0.0,                     !- Infrared Transmittance at Normal Incidence",
         "  0.84,                    !- Front Side Infrared Hemispherical Emissivity",
         "  0.84,                    !- Back Side Infrared Hemispherical Emissivity",
         "  0.9;                     !- Conductivity {W/m-K}",
         "Construction,",
         "  DOOR-CON,                !- Name",
         "  1.375in-Solid-Core;      !- Outside Layer",
         "Construction,",
         "  EXTWALL80,               !- Name",
         "  A1 - 1 IN STUCCO,        !- Outside Layer",
         "  C4 - 4 IN COMMON BRICK,  !- Layer 2",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD;  !- Layer 3",
         "Construction,",
         "  PARTITION06,             !- Name",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD,  !- Outside Layer",
         "  C6 - 8 IN CLAY TILE,     !- Layer 2",
         "  E1 - 3 / 4 IN PLASTER OR GYP BOARD;  !- Layer 3",
         "  Construction,",
         "  FLOOR SLAB 8 IN,         !- Name",
         "  C10 - 8 IN HW CONCRETE;  !- Outside Layer",
         "Construction,",
         "  ROOF34,                  !- Name",
         "  E2 - 1 / 2 IN SLAG OR STONE,  !- Outside Layer",
         "  E3 - 3 / 8 IN FELT AND MEMBRANE,  !- Layer 2",
         "  B5 - 1 IN DENSE INSULATION,  !- Layer 3",
         "  C12 - 2 IN HW CONCRETE;  !- Layer 4",
         "Construction,",
         "  WIN-CON-LIGHT,           !- Name",
         "  WIN-LAY-GLASS-LIGHT;     !- Outside Layer",
         "Zone,",
         "  WEST_ZONE,               !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "Zone,",
         "  EAST_ZONE,               !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "Zone,",
         "  NORTH_ZONE,              !- Name",
         "  0,                       !- Direction of Relative North {deg}",
         "  0,                       !- X Origin {m}",
         "  0,                       !- Y Origin {m}",
         "  0,                       !- Z Origin {m}",
         "  1,                       !- Type",
         "  1,                       !- Multiplier",
         "  autocalculate;           !- Ceiling Height {m}",
         "GlobalGeometryRules,",
         "  UpperLeftCorner,         !- Starting Vertex Position",
         "  CounterClockWise,        !- Vertex Entry Direction",
         "  World;                   !- Coordinate System",
         "BuildingSurface:Detailed,",
         "  Surface_1,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,0,3.048000,            !- X,Y,Z ==> Vertex 1 {m}",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_2,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 3 {m}",
         "  0,0,3.048000;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_3,               !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_17,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  0,6.096000,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_4,               !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_10,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_5,               !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_5,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,0,0,                   !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,0,0;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_6,               !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  WEST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,0,3.048000,            !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_8,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_9,               !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,0,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,0,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_10,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_4,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096001,0,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_11,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_18,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_12,              !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_12,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,0,0,            !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,     !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,0,0;            !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_13,              !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  EAST_ZONE,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,0,3.048000,     !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,0,3.048000,     !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_14,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,12.19200,3.048000,     !- X,Y,Z ==> Vertex 1 {m}",
         "  0,12.19200,0,            !- X,Y,Z ==> Vertex 2 {m}",
         "  0,6.096000,0,            !- X,Y,Z ==> Vertex 3 {m}",
         "  0,6.096000,3.048000;     !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_15,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_16,              !- Name",
         "  WALL,                    !- Surface Type",
         "  EXTWALL80,               !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_17,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_3,               !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0.000,6.096,3.048,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000,6.096,0.000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096,6.096,0.000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096,6.096,3.048;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_18,              !- Name",
         "  WALL,                    !- Surface Type",
         "  PARTITION06,             !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_11,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.5000000,               !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000,6.096000,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000,6.096000,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_19,              !- Name",
         "  FLOOR,                   !- Surface Type",
         "  FLOOR SLAB 8 IN,         !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Surface,                 !- Outside Boundary Condition",
         "  Surface_19,              !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  1.000000,                !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,6.096000,0,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,12.19200,0,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,12.19200,0,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,6.096000,0;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  Surface_20,              !- Name",
         "  ROOF,                    !- Surface Type",
         "  ROOF34,                  !- Construction Name",
         "  NORTH_ZONE,              !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  0,                       !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0,12.19200,3.048000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0,6.096000,3.048000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  12.19200,6.096000,3.048000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  12.19200,12.19200,3.048000;  !- X,Y,Z ==> Vertex 4 {m}",
         "AirflowNetwork:SimulationControl,",
         "  NaturalVentilation,      !- Name",
         "  MultizoneWithoutDistribution,  !- AirflowNetwork Control",
         "  INPUT,                   !- Wind Pressure Coefficient Type",
         "  ExternalNode,            !- Height Selection for Local Wind Pressure Calculation",
         "  LOWRISE,                 !- Building Type",
         "  500,                     !- Maximum Number of Iterations {dimensionless}",
         "  ZeroNodePressures,       !- Initialization Type",
         "  1.0E-05,                 !- Relative Airflow Convergence Tolerance {dimensionless}",
         "  1.0E-06,                 !- Absolute Airflow Convergence Tolerance {kg/s}",
         "  -0.5,                    !- Convergence Acceleration Limit {dimensionless}",
         "  0.0,                     !- Azimuth Angle of Long Axis of Building {deg}",
         "  1.0;                     !- Ratio of Building Width Along Short Axis to Width Along Long Axis",
         "AirflowNetwork:MultiZone:Zone,",
         "  WEST_ZONE,               !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  0.3,                     !- Minimum Venting Open Factor {dimensionless}",
         "  5.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  10.0,                    !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Zone,",
         "  EAST_ZONE,               !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  1.0,                     !- Minimum Venting Open Factor {dimensionless}",
         "  0.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  100.0,                   !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Zone,",
         "  NORTH_ZONE,              !- Zone Name",
         "  NoVent,                  !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  1.0,                     !- Minimum Venting Open Factor {dimensionless}",
         "  0.0,                     !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  100.0,                   !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  0.0,                     !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  300000.0;                !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_1,               !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  SFacade,                 !- External Node Name",
         "  1.0;                     !- Window/Door Opening Factor, or Crack Factor {dimensionless}",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_4,               !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_11,              !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:Surface,",
         "  Surface_15,              !- Surface Name",
         "  CR-1,                    !- Leakage Component Name",
         "  NFacade,                 !- External Node Name",
         "  1.0;                     !- Window / Door Opening Factor, or Crack Factor{ dimensionless }",
         "AirflowNetwork:MultiZone:ExternalNode,",
         "  NFacade,                 !- Name",
         "  1.524,                   !- External Node Height{ m }",
         "  NFacade_WPCCurve;        !- Wind Pressure Coefficient Values Object Name",
         "OutdoorAir:Node,",
         "  SFacade,                 !- Name",
         "  ,                        !- Height Above Ground",
         "  ,                        !- Drybulb Temperature Schedule Name",
         "  ,                        !- Wetbulb Temperature Schedule Name",
         "  ,                        !- Wind Speed Schedule Name",
         "  ,                        !- Wind Direction Schedule Name",
         "  SFacade_WPCCurve,        !- Wind Pressure Coefficient Values Object Name",
         "  No,                      !- Symmetric Wind Pressure Coefficient Curve",
         "  Absolute;                !- Wind Angle Type",
         "OutdoorAir:Node,",
         "  Model Outdoor Air Node;   !- Name",
         "AirflowNetwork:MultiZone:ReferenceCrackConditions,",
         "  ReferenceCrackConditions,!- Name",
         "  20.0,                    !- Reference Temperature{ C }",
         "  101320,                  !- Reference Barometric Pressure{ Pa }",
         "  0.005;                   !- Reference Humidity Ratio{ kgWater / kgDryAir }",
         "AirflowNetwork:MultiZone:Surface:Crack,",
         "  CR-1,                    !- Name",
         "  0.01,                    !- Air Mass Flow Coefficient at Reference Conditions{ kg / s }",
         "  0.667,                   !- Air Mass Flow Exponent{ dimensionless }",
         "  ReferenceCrackConditions;!- Reference Crack Conditions",

         "Table:IndependentVariable,",
         "  Wind_Direction_30_deg,     !- Name",
         "  Linear,                    !- Interpolation Method",
         "  Constant,                  !- Extrapolation Method",
         "  0,                         !- Minimum Value",
         "  360,                       !- Maximum Value",
         "  ,                          !- Normalization Reference Value",
         "  Dimensionless,             !- Unit Type",
         "  ,                          !- External File Name",
         "  ,                          !- External File Column Number",
         "  ,                          !- External File Starting Row Number",
         "  0,                         !- Value 1",
         "  30,",
         "  60,",
         "  90,",
         "  120,",
         "  150,",
         "  180,",
         "  210,",
         "  240,",
         "  270,",
         "  300,",
         "  330,",
         "  360;",

         "Table:IndependentVariableList,",
         "  Wind_Pressure_Variables,   !- Name",
         "  Wind_Direction_30_deg;     !- Independent Variable 1 Name",

         "Table:Lookup,",
         "  NFacade_WPCCurve,          !- Name",
         "  Wind_Pressure_Variables,   !- Independent Variable List Name",
         "  ,                          !- Normalization Method",
         "  ,                          !- Normalization Divisor",
         "  -1,                        !- Minimum Output",
         "  1,                         !- Maximum Output",
         "  Dimensionless,             !- Output Unit Type",
         "  ,                          !- External File Name",
         "  ,                          !- External File Column Number",
         "  ,                          !- External File Starting Row Number",
         "  0.60,                      !- Output Value 1",
         "  0.48,",
         "  0.04,",
         "  -0.56,",
         "  -0.56,",
         "  -0.42,",
         "  -0.37,",
         "  -0.42,",
         "  -0.56,",
         "  -0.56,",
         "  0.04,",
         "  0.48,",
         "  0.60;",

         "Table:Lookup,",
         "  SFacade_WPCCurve,          !- Name",
         "  Wind_Pressure_Variables,   !- Independent Variable List Name",
         "  ,                          !- Normalization Method",
         "  ,                          !- Normalization Divisor",
         "  -1,                        !- Minimum Output",
         "  1,                         !- Maximum Output",
         "  Dimensionless,             !- Output Unit Type",
         "  ,                          !- External File Name",
         "  ,                          !- External File Column Number",
         "  ,                          !- External File Starting Row Number",
         "  -0.37,                     !- Output Value 1",
         "  -0.42,",
         "  -0.56,",
         "  -0.56,",
         "  0.04,",
         "  0.48,",
         "  0.60,",
         "  0.48,",
         "  0.04,",
         "  -0.56,",
         "  -0.56,",
         "  -0.42,",
         "  -0.37;",

         "SurfaceConvectionAlgorithm:Inside,TARP;",
         "SurfaceConvectionAlgorithm:Outside,DOE-2;",
         "HeatBalanceAlgorithm,ConductionTransferFunction;",
         "ZoneAirHeatBalanceAlgorithm,",
         "  AnalyticalSolution;      !- Algorithm"});
    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);

    // Set up some environmental parameters
    state->dataEnvrn->OutBaroPress = 101325.0;
    state->dataEnvrn->OutDryBulbTemp = 25.0;
    state->dataEnvrn->WindDir = 105.0;
    state->dataEnvrn->OutHumRat = 0.0;        // Dry air only
    state->dataEnvrn->SiteTempGradient = 0.0; // Disconnect z from testing
    state->dataEnvrn->SiteWindExp = 0.0;      // Disconnect variation by height
    state->dataEnvrn->WindSpeed = 10.0;

    HeatBalanceManager::GetHeatBalanceInput(*state);
    HeatBalanceManager::AllocateHeatBalArrays(*state);
    state->dataHVACGlobal->TimeStepSys = state->dataGlobal->TimeStepZone;
    state->dataHVACGlobal->TimeStepSysSec = state->dataHVACGlobal->TimeStepSys * Constant::rSecsInHour;

    EXPECT_EQ(state->dataCurveManager->curves.size(), 2);

    state->dataGlobal->AnyLocalEnvironmentsInModel = true;
    OutAirNodeManager::SetOutAirNodes(*state);
    state->afn->get_input();
    // Issue 7656
    std::string const error_string = delimited_string({
        //"   ** Warning ** No Timestep object found.  Number of TimeSteps in Hour defaulted to 4.",
        "   ** Warning ** CheckUsedConstructions: There are 2 nominally unused constructions in input.",
        "   **   ~~~   ** For explicit details on each unused construction, use Output:Diagnostics,DisplayExtraWarnings;",
    });
    EXPECT_TRUE(compare_err_stream(error_string, true));
    state->afn->initialize();

    // Check the airflow elements
    EXPECT_EQ(2u, state->afn->MultizoneExternalNodeData.size());
    EXPECT_EQ(3u, state->afn->MultizoneZoneData.size());
    EXPECT_EQ(4u, state->afn->MultizoneSurfaceData.size());
    EXPECT_EQ(1u, state->afn->MultizoneSurfaceCrackData.size());

    EXPECT_EQ(0.0, state->afn->MultizoneExternalNodeData(1).azimuth);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(1).symmetricCurve);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(1).useRelativeAngle);
    EXPECT_EQ(1, state->afn->MultizoneExternalNodeData(1).curve);

    EXPECT_EQ(180.0, state->afn->MultizoneExternalNodeData(2).azimuth);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(2).symmetricCurve);
    EXPECT_FALSE(state->afn->MultizoneExternalNodeData(2).useRelativeAngle);
    EXPECT_EQ(2, state->afn->MultizoneExternalNodeData(2).curve);

    // Make sure we can compute the right wind pressure
    state->dataLoopNodes->Node(1).OutAirWindSpeed = 1.0;
    state->dataLoopNodes->Node(1).OutAirDryBulb = 15.0;
    Real64 rho_1 = Psychrometrics::PsyRhoAirFnPbTdbW(
        *state, state->dataEnvrn->OutBaroPress, state->dataLoopNodes->Node(1).OutAirDryBulb, state->dataLoopNodes->Node(1).HumRat);
    Real64 rho_2 =
        Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, state->dataEnvrn->OutDryBulbTemp, state->dataEnvrn->OutHumRat);
    EXPECT_DOUBLE_EQ(1.2252059842834473, rho_1);
    EXPECT_DOUBLE_EQ(1.1841123742118911, rho_2);

    Real64 p = state->afn->calculate_wind_pressure(state->afn->MultizoneExternalNodeData(1).curve,
                                                   false,
                                                   false,
                                                   0.0,
                                                   state->dataLoopNodes->Node(1).OutAirWindSpeed,
                                                   state->dataLoopNodes->Node(1).OutAirWindDir,
                                                   state->dataLoopNodes->Node(1).OutAirDryBulb,
                                                   state->dataLoopNodes->Node(1).HumRat);
    EXPECT_DOUBLE_EQ(-0.56 * 0.5 * 1.2252059842834473, p);

    // Run the balance routine, for now only to get the pressure set at the external nodes

    state->afn->calculate_balance();
    // Make sure we set the right temperature
    EXPECT_DOUBLE_EQ(25.0, state->afn->AirflowNetworkNodeSimu(4).TZ);
    EXPECT_DOUBLE_EQ(15.0, state->afn->AirflowNetworkNodeSimu(5).TZ);
    EXPECT_DOUBLE_EQ(4.7384645696854548, DataEnvironment::WindSpeedAt(*state, 1.524));
    // Global wind speed 10 m/s, temp 25 C; Local wind speed 1 m/s, temp 15 C;
    EXPECT_DOUBLE_EQ(-0.56 * 0.5 * rho_2 * 4.7384645696854548 * 4.7384645696854548, state->afn->AirflowNetworkNodeSimu(4).PZ);
    EXPECT_DOUBLE_EQ(-0.26 * 0.5 * rho_1, state->afn->AirflowNetworkNodeSimu(5).PZ);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_BasicAdvancedSingleSided)
{
    std::string const idf_objects = delimited_string(
        {"SimulationControl,",
         "  No,                      !- Do Zone Sizing Calculation",
         "  No,                      !- Do System Sizing Calculation",
         "  No,                      !- Do Plant Sizing Calculation",
         "  No,                      !- Run Simulation for Sizing Periods",
         "  Yes;                     !- Run Simulation for Weather File Run Periods",
         "Building,",
         "  Single Sided Demo Building,  !- Name",
         "  0.0,                     !- North Axis {deg}",
         "  Suburbs,                 !- Terrain",
         "  0.04,                    !- Loads Convergence Tolerance Value",
         "  0.4,                     !- Temperature Convergence Tolerance Value {deltaC}",
         "  FullInteriorAndExterior, !- Solar Distribution",
         "  25,                      !- Maximum Number of Warmup Days",
         "  ;                        !- Minimum Number of Warmup Days",
         "Timestep,4;",
         "Site:Location,",
         "  San Francisco Intl Ap_CA_USA Design_Conditions,  !- Name",
         "  37.62,                   !- Latitude {deg}",
         "  -122.40,                 !- Longitude {deg}",
         "  -8.00,                   !- Time Zone {hr}",
         "  2.00;                    !- Elevation {m}",
         "Site:GroundTemperature:BuildingSurface,19.905,19.922,19.910,19.932,19.949,20.038,20.327,20.062,20.443,20.088,19.986,19.948;",
         "RunPeriod,",
         "  RunPeriod1,              !- Name",
         "  1,                       !- Begin Month",
         "  1,                       !- Begin Day of Month",
         "  ,                        !- Begin Year",
         "  12,                      !- End Month",
         "  31,                      !- End Day of Month",
         "  ,                        !- End Year",
         "  Sunday,                  !- Day of Week for Start Day",
         "  Yes,                     !- Use Weather File Holidays and Special Days",
         "  Yes,                     !- Use Weather File Daylight Saving Period",
         "  No,                      !- Apply Weekend Holiday Rule",
         "  Yes,                     !- Use Weather File Rain Indicators",
         "  Yes;                     !- Use Weather File Snow Indicators",
         "Material,",
         "  F08 Metal surface,       !- Name",
         "  Smooth,                  !- Roughness",
         "  0.0008,                  !- Thickness {m}",
         "  45.28,                   !- Conductivity {W/m-K}",
         "  7824,                    !- Density {kg/m3}",
         "  500;                     !- Specific Heat {J/kg-K}",
         "Material,",
         "  I01 25mm insulation board,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.0254,                  !- Thickness {m}",
         "  0.03,                    !- Conductivity {W/m-K}",
         "  43,                      !- Density {kg/m3}",
         "  1210;                    !- Specific Heat {J/kg-K}",
         "Material,",
         "  I02 50mm insulation board,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.0508,                  !- Thickness {m}",
         "  0.03,                    !- Conductivity {W/m-K}",
         "  43,                      !- Density {kg/m3}",
         "  1210;                    !- Specific Heat {J/kg-K}",
         "Material,",
         "  G01a 19mm gypsum board,  !- Name",
         "  MediumSmooth,            !- Roughness",
         "  0.019,                   !- Thickness {m}",
         "  0.16,                    !- Conductivity {W/m-K}",
         "  800,                     !- Density {kg/m3}",
         "  1090;                    !- Specific Heat {J/kg-K}",
         "Material,",
         "  M11 100mm lightweight concrete,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.1016,                  !- Thickness {m}",
         "  0.53,                    !- Conductivity {W/m-K}",
         "  1280,                    !- Density {kg/m3}",
         "  840;                     !- Specific Heat {J/kg-K}",
         "Material,",
         "  F16 Acoustic tile,       !- Name",
         "  MediumSmooth,            !- Roughness",
         "  0.0191,                  !- Thickness {m}",
         "  0.06,                    !- Conductivity {W/m-K}",
         "  368,                     !- Density {kg/m3}",
         "  590;                     !- Specific Heat {J/kg-K}",
         "Material,",
         "  M01 100mm brick,         !- Name",
         "  MediumRough,             !- Roughness",
         "  0.1016,                  !- Thickness {m}",
         "  0.89,                    !- Conductivity {W/m-K}",
         "  1920,                    !- Density {kg/m3}",
         "  790;                     !- Specific Heat {J/kg-K}",
         "Material,",
         "  M15 200mm heavyweight concrete,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.2032,                  !- Thickness {m}",
         "  1.95,                    !- Conductivity {W/m-K}",
         "  2240,                    !- Density {kg/m3}",
         "  900;                     !- Specific Heat {J/kg-K}",
         "Material,",
         "  M05 200mm concrete block,!- Name",
         "  MediumRough,             !- Roughness",
         "  0.2032,                  !- Thickness {m}",
         "  1.11,                    !- Conductivity {W/m-K}",
         "  800,                     !- Density {kg/m3}",
         "  920;                     !- Specific Heat {J/kg-K}",
         "Material,",
         "  G05 25mm wood,           !- Name",
         "  MediumSmooth,            !- Roughness",
         "  0.0254,                  !- Thickness {m}",
         "  0.15,                    !- Conductivity {W/m-K}",
         "  608,                     !- Density {kg/m3}",
         "  1630;                    !- Specific Heat {J/kg-K}",
         "Material:AirGap,",
         "  F04 Wall air space resistance,  !- Name",
         "  0.15;                    !- Thermal Resistance {m2-K/W}",
         "Material:AirGap,",
         "  F05 Ceiling air space resistance,  !- Name",
         "  0.18;                    !- Thermal Resistance {m2-K/W}",
         "WindowMaterial:Glazing,",
         "  Clear 3mm,               !- Name",
         "  SpectralAverage,         !- Optical Data Type",
         "  ,                        !- Window Glass Spectral Data Set Name",
         "  0.003,                   !- Thickness {m}",
         "  0.837,                   !- Solar Transmittance at Normal Incidence",
         "  0.075,                   !- Front Side Solar Reflectance at Normal Incidence",
         "  0.075,                   !- Back Side Solar Reflectance at Normal Incidence",
         "  0.898,                   !- Visible Transmittance at Normal Incidence",
         "  0.081,                   !- Front Side Visible Reflectance at Normal Incidence",
         "  0.081,                   !- Back Side Visible Reflectance at Normal Incidence",
         "  0,                       !- Infrared Transmittance at Normal Incidence",
         "  0.84,                    !- Front Side Infrared Hemispherical Emissivity",
         "  0.84,                    !- Back Side Infrared Hemispherical Emissivity",
         "  0.9;                     !- Conductivity {W/m-K}",
         "WindowMaterial:Gas,",
         "  Air 13mm,                !- Name",
         "  Air,                     !- Gas Type",
         "  0.0127;                  !- Thickness {m}",
         "Construction,",
         "  Exterior Floor,          !- Name",
         "  I02 50mm insulation board,  !- Outside Layer",
         "  M15 200mm heavyweight concrete;  !- Layer 2",
         "Construction,",
         "  Exterior Wall,           !- Name",
         "  M01 100mm brick,         !- Outside Layer",
         "  M15 200mm heavyweight concrete,  !- Layer 2",
         "  I02 50mm insulation board,  !- Layer 3",
         "  F04 Wall air space resistance,  !- Layer 4",
         "  G01a 19mm gypsum board;  !- Layer 5",
         "Construction,",
         "  Interior Wall,           !- Name",
         "  G01a 19mm gypsum board,  !- Outside Layer",
         "  F04 Wall air space resistance,  !- Layer 2",
         "  G01a 19mm gypsum board;  !- Layer 3",
         "Construction,",
         "  Exterior Roof,           !- Name",
         "  M11 100mm lightweight concrete,  !- Outside Layer",
         "  F05 Ceiling air space resistance,  !- Layer 2",
         "  F16 Acoustic tile;       !- Layer 3",
         "Construction,",
         "  Exterior Window,         !- Name",
         "  Clear 3mm,               !- Outside Layer",
         "  Air 13mm,                !- Layer 2",
         "  Clear 3mm;               !- Layer 3",
         "GlobalGeometryRules,",
         "  UpperLeftCorner,         !- Starting Vertex Position",
         "  Counterclockwise,        !- Vertex Entry Direction",
         "  World;                   !- Coordinate System",
         "Zone,",
         "  West_Zone,               !- Name",
         "  0.0,                     !- Direction of Relative North {deg}",
         "  0.0,                     !- X Origin {m}",
         "  0.0,                     !- Y Origin {m}",
         "  0.0,                     !- Z Origin {m}",
         "  ,                        !- Type",
         "  1;                       !- Multiplier",
         "BuildingSurface:Detailed,",
         "  West_Zone_Floor,         !- Name",
         "  Floor,                   !- Surface Type",
         "  Exterior Floor,          !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Ground,                  !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.0,                     !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000000000,12.192000000000,0.000000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000000000,0.000000000000,0.000000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0.000000000000,0.000000000000,0.000000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0.000000000000,12.192000000000,0.000000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  West_Zone_West_Wall,     !- Name",
         "  Wall,                    !- Surface Type",
         "  Exterior Wall,           !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  ,                        !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0.000000000000,12.192000000000,3.048000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000000000000,12.192000000000,0.000000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0.000000000000,0.000000000000,0.000000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0.000000000000,0.000000000000,3.048000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  West_Zone_South_Wall,    !- Name",
         "  Wall,                    !- Surface Type",
         "  Exterior Wall,           !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  ,                        !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0.000000000000,0.000000000000,3.048000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000000000000,0.000000000000,0.000000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000000000,0.000000000000,0.000000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000000000,0.000000000000,3.048000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  West_Zone_North_Wall,    !- Name",
         "  Wall,                    !- Surface Type",
         "  Exterior Wall,           !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  ,                        !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000000000,12.192000000000,3.048000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000000000,12.192000000000,0.000000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0.000000000000,12.192000000000,0.000000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0.000000000000,12.192000000000,3.048000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  West_Zone_Roof,          !- Name",
         "  Roof,                    !- Surface Type",
         "  Exterior Roof,           !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  ,                        !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0.000000000000,12.192000000000,3.048000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000000000000,0.000000000000,3.048000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000000000,0.000000000000,3.048000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000000000,12.192000000000,3.048000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  West_Zone_East_Wall_S,   !- Name",
         "  Wall,                    !- Surface Type",
         "  Exterior Wall,           !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  ,                        !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000000000,0.000000000000,3.048000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000000000,0.000000000000,0.000000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000000000,6.096000000000,0.000000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000000000,6.096000000000,3.048000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  West_Zone_East_Wall_N,   !- Name",
         "  Wall,                    !- Surface Type",
         "  Exterior Wall,           !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  ,                        !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000000000,6.096000000000,3.048000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000000000,6.096000000000,0.000000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000000000,12.192000000000,0.000000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000000000,12.192000000000,3.048000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "FenestrationSurface:Detailed,",
         "  West_Zone_West_Wall_Left_Window,  !- Name",
         "  Window,                  !- Surface Type",
         "  Exterior Window,         !- Construction Name",
         "  West_Zone_West_Wall,     !- Building Surface Name",
         "  ,                        !- Outside Boundary Condition Object",
         "  ,                        !- View Factor to Ground",
         "  ,                        !- Frame and Divider Name",
         "  ,                        !- Multiplier",
         "  4,                       !- Number of Vertices",
         "  0.000000000000,10.668000000000,2.286000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000000000000,10.668000000000,0.762000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0.000000000000,9.144000000000,0.762000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0.000000000000,9.144000000000,2.286000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "FenestrationSurface:Detailed,",
         "  West_Zone_West_Wall_Right_Window,  !- Name",
         "  Window,                  !- Surface Type",
         "  Exterior Window,         !- Construction Name",
         "  West_Zone_West_Wall,     !- Building Surface Name",
         "  ,                        !- Outside Boundary Condition Object",
         "  ,                        !- View Factor to Ground",
         "  ,                        !- Frame and Divider Name",
         "  ,                        !- Multiplier",
         "  4,                       !- Number of Vertices",
         "  0.000000000000,3.048000000000,2.286000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000000000000,3.048000000000,0.762000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0.000000000000,1.524000000000,0.762000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0.000000000000,1.524000000000,2.286000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "AirflowNetwork:SimulationControl,",
         "  AFN_SimulationControl_1, !- Name",
         "  MultizoneWithoutDistribution,  !- AirflowNetwork Control",
         "  SurfaceAverageCalculation,  !- Wind Pressure Coefficient Type",
         "  OpeningHeight,           !- Height Selection for Local Wind Pressure Calculation",
         "  LowRise,                 !- Building Type",
         "  500,                     !- Maximum Number of Iterations {dimensionless}",
         "  ZeroNodePressures,       !- Initialization Type",
         "  1.0E-05,                 !- Relative Airflow Convergence Tolerance {dimensionless}",
         "  1.0E-06,                 !- Absolute Airflow Convergence Tolerance {kg/s}",
         "  -0.5,                    !- Convergence Acceleration Limit {dimensionless}",
         "  90,                      !- Azimuth Angle of Long Axis of Building {deg}",
         "  0.4;                     !- Ratio of Building Width Along Short Axis to Width Along Long Axis",
         "AirflowNetwork:MultiZone:Zone,",
         "  West_Zone,               !- Zone Name",
         "  Constant,                !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  ,                        !- Minimum Venting Open Factor {dimensionless}",
         "  ,                        !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  ,                        !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  ,                        !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  ,                        !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "  ,                        !- Venting Availability Schedule Name",
         "  Advanced,                !- Single Sided Wind Pressure Coefficient Algorithm",
         "  12.19;                   !- Facade Width {m}",
         "AirflowNetwork:MultiZone:Surface,",
         "  West_Zone_West_Wall_Right_Window,  !- Surface Name",
         "  SliderWindow,            !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1;                       !- Window/Door Opening Factor, or Crack Factor {dimensionless}",
         "AirflowNetwork:MultiZone:Surface,",
         "  West_Zone_West_Wall_Left_Window,  !- Surface Name",
         "  SliderWindow,            !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1;                       !- Window/Door Opening Factor, or Crack Factor {dimensionless}",
         "",
         "AirflowNetwork:MultiZone:Surface,",
         "  West_Zone_West_Wall,     !- Surface Name",
         "  WallCrack,               !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1;                       !- Window/Door Opening Factor, or Crack Factor {dimensionless}",
         "AirflowNetwork:MultiZone:Component:DetailedOpening,",
         "  SliderWindow,            !- Name",
         "  0.001,                   !- Air Mass Flow Coefficient When Opening is Closed {kg/s-m}",
         "  0.667,                   !- Air Mass Flow Exponent When Opening is Closed {dimensionless}",
         "  NonPivoted,              !- Type of Rectangular Large Vertical Opening (LVO)",
         "  0.0,                     !- Extra Crack Length or Height of Pivoting Axis {m}",
         "  2,                       !- Number of Sets of Opening Factor Data",
         "  0.0,                     !- Opening Factor 1 {dimensionless}",
         "  0.61,                    !- Discharge Coefficient for Opening Factor 1 {dimensionless}",
         "  0.0,                     !- Width Factor for Opening Factor 1 {dimensionless}",
         "  1.0,                     !- Height Factor for Opening Factor 1 {dimensionless}",
         "  0.0,                     !- Start Height Factor for Opening Factor 1 {dimensionless}",
         "  1.0,                     !- Opening Factor 2 {dimensionless}",
         "  0.61,                    !- Discharge Coefficient for Opening Factor 2 {dimensionless}",
         "  0.5,                     !- Width Factor for Opening Factor 2 {dimensionless}",
         "  1.0,                     !- Height Factor for Opening Factor 2 {dimensionless}",
         "  0.0;                     !- Start Height Factor for Opening Factor 2 {dimensionless}",
         "AirflowNetwork:MultiZone:Surface:Crack,",
         "  WallCrack,               !- Name",
         "  0.01,                    !- Air Mass Flow Coefficient at Reference Conditions {kg/s}",
         "  0.667;                   !- Air Mass Flow Exponent {dimensionless}",
         "AirflowNetwork:MultiZone:ReferenceCrackConditions,",
         "  ReferenceCrackConditions,!- Name",
         "  20.0,                    !- Reference Temperature {C}",
         "  101320,                  !- Reference Barometric Pressure {Pa}",
         "  0.005;                   !- Reference Humidity Ratio {kgWater/kgDryAir}"});

    std::vector<Real64> valsForLeftWindow = {
        -1.3130779955194276,  -1.7404152241877022,  -1.9384350312723766,  -1.8112879523426120,   -1.4903484929957291,  -1.1589328567607411,
        -0.90795075070620501, -0.75899946242534944, -0.70518117657458634, -0.73794026769189536,  -0.70518117657458634, -0.75899946242534944,
        -0.90795075070620501, -1.1589328567607411,  -1.4903484929957291,  -1.8112879523426120,   -1.9384350312723766,  -1.7404152241877022,
        -1.3130779955194276,  -0.81787534059945755, -0.32789581427586245, -0.051561623181424314, 0.15922353989407620,  0.38420139813526627,
        0.61892682388527165,  0.85109949645405880,  1.0664888091014251,   1.2510276050004789,    1.0664888091014251,   0.85109949645405880,
        0.61892682388527165,  0.38420139813526627,  0.15922353989407620,  -0.051561623181424314, -0.32789581427586245, -0.81787534059945755,
        -1.3130779955194276};

    std::vector<Real64> valsForRightWindow = {
        -0.56146269488642231,  -0.81031499432463261,  -0.88587800418632712,  -0.70219756773378639, -0.39543597375365452,  -0.14821874325853215,
        -0.045339946833489957, -0.097330100392452740, -0.28213089764929783,  -0.57310708635195429, -0.28213089764929783,  -0.097330100392452740,
        -0.045339946833489957, -0.14821874325853215,  -0.39543597375365452,  -0.70219756773378639, -0.88587800418632712,  -0.81031499432463261,
        -0.56146269488642231,  -0.28653692388308377,  -0.041152159946210520, 0.37465991281286887,  0.81696925904461237,   1.1829453813575432,
        1.4391966568855996,    1.5699546250680769,    1.5837385005116038,    1.5105973452216215,   1.5837385005116038,    1.5699546250680769,
        1.4391966568855996,    1.1829453813575432,    0.81696925904461237,   0.37465991281286887,  -0.041152159946210520, -0.28653692388308377,
        -0.56146269488642231};

    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);

    bool errors = false;

    Material::GetMaterialData(*state, errors); // read material data
    EXPECT_FALSE(errors);                      // expect no errors

    HeatBalanceManager::GetConstructData(*state, errors); // read construction data
    EXPECT_FALSE(errors);                                 // expect no errors

    HeatBalanceManager::GetZoneData(*state, errors); // read zone data
    EXPECT_FALSE(errors);                            // expect no errors

    // Magic to get surfaces read in correctly
    state->dataHeatBal->AnyCTF = true;
    state->dataSurfaceGeometry->CosBldgRotAppGonly = 1.0;
    state->dataSurfaceGeometry->SinBldgRotAppGonly = 0.0;

    SurfaceGeometry::GetSurfaceData(*state, errors); // setup zone geometry and get zone data
    EXPECT_FALSE(errors);                            // expect no errors

    EXPECT_EQ(0, state->dataCurveManager->curves.size());

    state->afn->get_input();

    // Check that the correct number of curves has been generated (5 facade directions + 2 windows)
    EXPECT_EQ(7, state->dataCurveManager->curves.size());

    // Check the airflow elements
    ASSERT_EQ(3u, state->afn->MultizoneExternalNodeData.size());
    EXPECT_EQ(1u, state->afn->MultizoneZoneData.size());
    EXPECT_EQ(3u, state->afn->MultizoneSurfaceData.size());
    EXPECT_EQ(1u, state->afn->MultizoneSurfaceCrackData.size());
    EXPECT_EQ(1u, state->afn->MultizoneCompDetOpeningData.size());

    EXPECT_EQ(270.0, state->afn->MultizoneExternalNodeData(1).azimuth);
    EXPECT_EQ(270.0, state->afn->MultizoneExternalNodeData(2).azimuth);
    EXPECT_EQ(270.0, state->afn->MultizoneExternalNodeData(3).azimuth);

    // Check the curve values for the left window, taken from v8.6.0 on Windows
    for (unsigned i = 0; i <= 36; i++) {
        Real64 angle = i * 10.0;
        Real64 value = Curve::CurveValue(*state, 7, angle);
        EXPECT_NEAR(valsForLeftWindow[i], value, 1.0e-12) << (format("Issue at index: {}", i));
    }

    // Check the curve values for the left window, taken from v8.6.0 on Windows
    for (unsigned i = 0; i <= 36; i++) {
        Real64 angle = i * 10.0;
        Real64 value = Curve::CurveValue(*state, 6, angle);
        EXPECT_NEAR(valsForRightWindow[i], value, 1.0e-12) << (format("Issue at index: {}", i));
    }
}

TEST_F(EnergyPlusFixture, AirflowNetwork_BasicAdvancedSingleSidedAvoidCrashTest)
{
    std::string const idf_objects = delimited_string(
        {"SimulationControl,",
         "  No,                      !- Do Zone Sizing Calculation",
         "  No,                      !- Do System Sizing Calculation",
         "  No,                      !- Do Plant Sizing Calculation",
         "  No,                      !- Run Simulation for Sizing Periods",
         "  Yes;                     !- Run Simulation for Weather File Run Periods",
         "Building,",
         "  Single Sided Demo Building,  !- Name",
         "  0.0,                     !- North Axis {deg}",
         "  Suburbs,                 !- Terrain",
         "  0.04,                    !- Loads Convergence Tolerance Value",
         "  0.4,                     !- Temperature Convergence Tolerance Value {deltaC}",
         "  FullInteriorAndExterior, !- Solar Distribution",
         "  25,                      !- Maximum Number of Warmup Days",
         "  ;                        !- Minimum Number of Warmup Days",
         "Timestep,4;",
         "Site:Location,",
         "  San Francisco Intl Ap_CA_USA Design_Conditions,  !- Name",
         "  37.62,                   !- Latitude {deg}",
         "  -122.40,                 !- Longitude {deg}",
         "  -8.00,                   !- Time Zone {hr}",
         "  2.00;                    !- Elevation {m}",
         "Site:GroundTemperature:BuildingSurface,19.905,19.922,19.910,19.932,19.949,20.038,20.327,20.062,20.443,20.088,19.986,19.948;",
         "RunPeriod,",
         "  RunPeriod1,              !- Name",
         "  1,                       !- Begin Month",
         "  1,                       !- Begin Day of Month",
         " ,                        !- Begin Year",
         "  12,                      !- End Month",
         "  31,                      !- End Day of Month",
         " ,                        !- End Year",
         "  Sunday,                  !- Day of Week for Start Day",
         "  Yes,                     !- Use Weather File Holidays and Special Days",
         "  Yes,                     !- Use Weather File Daylight Saving Period",
         "  No,                      !- Apply Weekend Holiday Rule",
         "  Yes,                     !- Use Weather File Rain Indicators",
         "  Yes;                     !- Use Weather File Snow Indicators",
         "Material,",
         "  F08 Metal surface,       !- Name",
         "  Smooth,                  !- Roughness",
         "  0.0008,                  !- Thickness {m}",
         "  45.28,                   !- Conductivity {W/m-K}",
         "  7824,                    !- Density {kg/m3}",
         "  500;                     !- Specific Heat {J/kg-K}",
         "Material,",
         "  I01 25mm insulation board,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.0254,                  !- Thickness {m}",
         "  0.03,                    !- Conductivity {W/m-K}",
         "  43,                      !- Density {kg/m3}",
         "  1210;                    !- Specific Heat {J/kg-K}",
         "Material,",
         "  I02 50mm insulation board,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.0508,                  !- Thickness {m}",
         "  0.03,                    !- Conductivity {W/m-K}",
         "  43,                      !- Density {kg/m3}",
         "  1210;                    !- Specific Heat {J/kg-K}",
         "Material,",
         "  G01a 19mm gypsum board,  !- Name",
         "  MediumSmooth,            !- Roughness",
         "  0.019,                   !- Thickness {m}",
         "  0.16,                    !- Conductivity {W/m-K}",
         "  800,                     !- Density {kg/m3}",
         "  1090;                    !- Specific Heat {J/kg-K}",
         "Material,",
         "  M11 100mm lightweight concrete,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.1016,                  !- Thickness {m}",
         "  0.53,                    !- Conductivity {W/m-K}",
         "  1280,                    !- Density {kg/m3}",
         "  840;                     !- Specific Heat {J/kg-K}",
         "Material,",
         "  F16 Acoustic tile,       !- Name",
         "  MediumSmooth,            !- Roughness",
         "  0.0191,                  !- Thickness {m}",
         "  0.06,                    !- Conductivity {W/m-K}",
         "  368,                     !- Density {kg/m3}",
         "  590;                     !- Specific Heat {J/kg-K}",
         "Material,",
         "  M01 100mm brick,         !- Name",
         "  MediumRough,             !- Roughness",
         "  0.1016,                  !- Thickness {m}",
         "  0.89,                    !- Conductivity {W/m-K}",
         "  1920,                    !- Density {kg/m3}",
         "  790;                     !- Specific Heat {J/kg-K}",
         "Material,",
         "  M15 200mm heavyweight concrete,  !- Name",
         "  MediumRough,             !- Roughness",
         "  0.2032,                  !- Thickness {m}",
         "  1.95,                    !- Conductivity {W/m-K}",
         "  2240,                    !- Density {kg/m3}",
         "  900;                     !- Specific Heat {J/kg-K}",
         "Material,",
         "  M05 200mm concrete block,!- Name",
         "  MediumRough,             !- Roughness",
         "  0.2032,                  !- Thickness {m}",
         "  1.11,                    !- Conductivity {W/m-K}",
         "  800,                     !- Density {kg/m3}",
         "  920;                     !- Specific Heat {J/kg-K}",
         "Material,",
         "  G05 25mm wood,           !- Name",
         "  MediumSmooth,            !- Roughness",
         "  0.0254,                  !- Thickness {m}",
         "  0.15,                    !- Conductivity {W/m-K}",
         "  608,                     !- Density {kg/m3}",
         "  1630;                    !- Specific Heat {J/kg-K}",
         "Material:AirGap,",
         "  F04 Wall air space resistance,  !- Name",
         "  0.15;                    !- Thermal Resistance {m2-K/W}",
         "Material:AirGap,",
         "  F05 Ceiling air space resistance,  !- Name",
         "  0.18;                    !- Thermal Resistance {m2-K/W}",
         "WindowMaterial:Glazing,",
         "  Clear 3mm,               !- Name",
         "  SpectralAverage,         !- Optical Data Type",
         "  ,                        !- Window Glass Spectral Data Set Name",
         "  0.003,                   !- Thickness {m}",
         "  0.837,                   !- Solar Transmittance at Normal Incidence",
         "  0.075,                   !- Front Side Solar Reflectance at Normal Incidence",
         "  0.075,                   !- Back Side Solar Reflectance at Normal Incidence",
         "  0.898,                   !- Visible Transmittance at Normal Incidence",
         "  0.081,                   !- Front Side Visible Reflectance at Normal Incidence",
         "  0.081,                   !- Back Side Visible Reflectance at Normal Incidence",
         "  0,                       !- Infrared Transmittance at Normal Incidence",
         "  0.84,                    !- Front Side Infrared Hemispherical Emissivity",
         "  0.84,                    !- Back Side Infrared Hemispherical Emissivity",
         "  0.9;                     !- Conductivity {W/m-K}",
         "WindowMaterial:Gas,",
         "  Air 13mm,                !- Name",
         "  Air,                     !- Gas Type",
         "  0.0127;                  !- Thickness {m}",
         "Construction,",
         "  Exterior Floor,          !- Name",
         "  I02 50mm insulation board,  !- Outside Layer",
         "  M15 200mm heavyweight concrete;  !- Layer 2",
         "Construction,",
         "  Exterior Wall,           !- Name",
         "  M01 100mm brick,         !- Outside Layer",
         "  M15 200mm heavyweight concrete,  !- Layer 2",
         "  I02 50mm insulation board,  !- Layer 3",
         "  F04 Wall air space resistance,  !- Layer 4",
         "  G01a 19mm gypsum board;  !- Layer 5",
         "Construction,",
         "  Interior Wall,           !- Name",
         "  G01a 19mm gypsum board,  !- Outside Layer",
         "  F04 Wall air space resistance,  !- Layer 2",
         "  G01a 19mm gypsum board;  !- Layer 3",
         "Construction,",
         "  Exterior Roof,           !- Name",
         "  M11 100mm lightweight concrete,  !- Outside Layer",
         "  F05 Ceiling air space resistance,  !- Layer 2",
         "  F16 Acoustic tile;       !- Layer 3",
         "Construction,",
         "  Exterior Window,         !- Name",
         "  Clear 3mm,               !- Outside Layer",
         "  Air 13mm,                !- Layer 2",
         "  Clear 3mm;               !- Layer 3",
         "GlobalGeometryRules,",
         "  UpperLeftCorner,         !- Starting Vertex Position",
         "  Counterclockwise,        !- Vertex Entry Direction",
         "  World;                   !- Coordinate System",
         "Zone,",
         "  West_Zone,               !- Name",
         "  0.0,                     !- Direction of Relative North {deg}",
         "  0.0,                     !- X Origin {m}",
         "  0.0,                     !- Y Origin {m}",
         "  0.0,                     !- Z Origin {m}",
         "  ,                        !- Type",
         "  1;                       !- Multiplier",
         "BuildingSurface:Detailed,",
         "  West_Zone_Floor,         !- Name",
         "  Floor,                   !- Surface Type",
         "  Exterior Floor,          !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Ground,                  !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  NoSun,                   !- Sun Exposure",
         "  NoWind,                  !- Wind Exposure",
         "  0.0,                     !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000000000,12.192000000000,0.000000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000000000,0.000000000000,0.000000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0.000000000000,0.000000000000,0.000000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0.000000000000,12.192000000000,0.000000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  West_Zone_West_Wall,     !- Name",
         "  Wall,                    !- Surface Type",
         "  Exterior Wall,           !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  ,                        !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0.000000000000,12.192000000000,3.048000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000000000000,12.192000000000,0.000000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0.000000000000,0.000000000000,0.000000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0.000000000000,0.000000000000,3.048000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  West_Zone_South_Wall,    !- Name",
         "  Wall,                    !- Surface Type",
         "  Exterior Wall,           !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  ,                        !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0.000000000000,0.000000000000,3.048000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000000000000,0.000000000000,0.000000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000000000,0.000000000000,0.000000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000000000,0.000000000000,3.048000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  West_Zone_North_Wall,    !- Name",
         "  Wall,                    !- Surface Type",
         "  Exterior Wall,           !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  ,                        !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000000000,12.192000000000,3.048000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000000000,12.192000000000,0.000000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0.000000000000,12.192000000000,0.000000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0.000000000000,12.192000000000,3.048000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  West_Zone_Roof,          !- Name",
         "  Roof,                    !- Surface Type",
         "  Exterior Roof,           !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  ,                        !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  0.000000000000,12.192000000000,3.048000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000000000000,0.000000000000,3.048000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000000000,0.000000000000,3.048000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000000000,12.192000000000,3.048000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  West_Zone_East_Wall_S,   !- Name",
         "  Wall,                    !- Surface Type",
         "  Exterior Wall,           !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  ,                        !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000000000,0.000000000000,3.048000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000000000,0.000000000000,0.000000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000000000,6.096000000000,0.000000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000000000,6.096000000000,3.048000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "BuildingSurface:Detailed,",
         "  West_Zone_East_Wall_N,   !- Name",
         "  Wall,                    !- Surface Type",
         "  Exterior Wall,           !- Construction Name",
         "  West_Zone,               !- Zone Name",
         "    ,                        !- Space Name",
         "  Outdoors,                !- Outside Boundary Condition",
         "  ,                        !- Outside Boundary Condition Object",
         "  SunExposed,              !- Sun Exposure",
         "  WindExposed,             !- Wind Exposure",
         "  ,                        !- View Factor to Ground",
         "  4,                       !- Number of Vertices",
         "  6.096000000000,6.096000000000,3.048000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  6.096000000000,6.096000000000,0.000000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  6.096000000000,12.192000000000,0.000000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  6.096000000000,12.192000000000,3.048000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "FenestrationSurface:Detailed,",
         "  West_Zone_West_Wall_Left_Window,  !- Name",
         "  Window,                  !- Surface Type",
         "  Exterior Window,         !- Construction Name",
         "  West_Zone_West_Wall,     !- Building Surface Name",
         "  ,                        !- Outside Boundary Condition Object",
         "  ,                        !- View Factor to Ground",
         "  ,                        !- Frame and Divider Name",
         "  ,                        !- Multiplier",
         "  4,                       !- Number of Vertices",
         "  0.000000000000,10.668000000000,2.286000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000000000000,10.668000000000,0.762000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0.000000000000,9.144000000000,0.762000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0.000000000000,9.144000000000,2.286000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "FenestrationSurface:Detailed,",
         "  West_Zone_West_Wall_Right_Window,  !- Name",
         "  Window,                  !- Surface Type",
         "  Exterior Window,         !- Construction Name",
         "  West_Zone_West_Wall,     !- Building Surface Name",
         "  ,                        !- Outside Boundary Condition Object",
         "  ,                        !- View Factor to Ground",
         "  ,                        !- Frame and Divider Name",
         "  ,                        !- Multiplier",
         "  4,                       !- Number of Vertices",
         "  0.000000000000,3.048000000000,2.286000000000,  !- X,Y,Z ==> Vertex 1 {m}",
         "  0.000000000000,3.048000000000,0.762000000000,  !- X,Y,Z ==> Vertex 2 {m}",
         "  0.000000000000,1.524000000000,0.762000000000,  !- X,Y,Z ==> Vertex 3 {m}",
         "  0.000000000000,1.524000000000,2.286000000000;  !- X,Y,Z ==> Vertex 4 {m}",
         "AirflowNetwork:SimulationControl,",
         "  AFN_SimulationControl_1, !- Name",
         "  MultizoneWithoutDistribution,  !- AirflowNetwork Control",
         "  SurfaceAverageCalculation,  !- Wind Pressure Coefficient Type",
         "  OpeningHeight,           !- Height Selection for Local Wind Pressure Calculation",
         "  LowRise,                 !- Building Type",
         "  500,                     !- Maximum Number of Iterations {dimensionless}",
         "  ZeroNodePressures,       !- Initialization Type",
         "  1.0E-05,                 !- Relative Airflow Convergence Tolerance {dimensionless}",
         "  1.0E-06,                 !- Absolute Airflow Convergence Tolerance {kg/s}",
         "  -0.5,                    !- Convergence Acceleration Limit {dimensionless}",
         "  90,                      !- Azimuth Angle of Long Axis of Building {deg}",
         "  0.4;                     !- Ratio of Building Width Along Short Axis to Width Along Long Axis",
         "AirflowNetwork:MultiZone:Zone,",
         "  West_Zone,               !- Zone Name",
         "  Constant,                !- Ventilation Control Mode",
         "  ,                        !- Ventilation Control Zone Temperature Setpoint Schedule Name",
         "  ,                        !- Minimum Venting Open Factor {dimensionless}",
         "  ,                        !- Indoor and Outdoor Temperature Difference Lower Limit For Maximum Venting Open Factor {deltaC}",
         "  ,                        !- Indoor and Outdoor Temperature Difference Upper Limit for Minimum Venting Open Factor {deltaC}",
         "  ,                        !- Indoor and Outdoor Enthalpy Difference Lower Limit For Maximum Venting Open Factor {deltaJ/kg}",
         "  ,                        !- Indoor and Outdoor Enthalpy Difference Upper Limit for Minimum Venting Open Factor {deltaJ/kg}",
         "  ,                        !- Venting Availability Schedule Name",
         "  Advanced,                !- Single Sided Wind Pressure Coefficient Algorithm",
         "  12.19;                   !- Facade Width {m}",
         "AirflowNetwork:MultiZone:Surface,",
         "  West_Zone_West_Wall_Right_Window,  !- Surface Name",
         "  SliderWindow,            !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1;                       !- Window/Door Opening Factor, or Crack Factor {dimensionless}",
         "AirflowNetwork:MultiZone:Surface,",
         "  West_Zone_West_Wall_Left_Window,  !- Surface Name",
         "  SliderWindow,            !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1;                       !- Window/Door Opening Factor, or Crack Factor {dimensionless}",
         "",
         "AirflowNetwork:MultiZone:Surface,",
         "  West_Zone_West_Wall,     !- Surface Name",
         "  WallCrack,               !- Leakage Component Name",
         "  ,                        !- External Node Name",
         "  1;                       !- Window/Door Opening Factor, or Crack Factor {dimensionless}",
         "AirflowNetwork:MultiZone:Component:DetailedOpening,",
         "  SliderWindow,            !- Name",
         "  0.001,                   !- Air Mass Flow Coefficient When Opening is Closed {kg/s-m}",
         "  0.667,                   !- Air Mass Flow Exponent When Opening is Closed {dimensionless}",
         "  NonPivoted,              !- Type of Rectangular Large Vertical Opening (LVO)",
         "  0.0,                     !- Extra Crack Length or Height of Pivoting Axis {m}",
         "  2,                       !- Number of Sets of Opening Factor Data",
         "  0.0,                     !- Opening Factor 1 {dimensionless}",
         "  0.61,                    !- Discharge Coefficient for Opening Factor 1 {dimensionless}",
         "  0.0,                     !- Width Factor for Opening Factor 1 {dimensionless}",
         "  1.0,                     !- Height Factor for Opening Factor 1 {dimensionless}",
         "  0.0,                     !- Start Height Factor for Opening Factor 1 {dimensionless}",
         "  1.0,                     !- Opening Factor 2 {dimensionless}",
         "  0.61,                    !- Discharge Coefficient for Opening Factor 2 {dimensionless}",
         "  0.5,                     !- Width Factor for Opening Factor 2 {dimensionless}",
         "  1.0,                     !- Height Factor for Opening Factor 2 {dimensionless}",
         "  0.0;                     !- Start Height Factor for Opening Factor 2 {dimensionless}",
         "AirflowNetwork:MultiZone:Surface:Crack,",
         "  WallCrack,               !- Name",
         "  0.01,                    !- Air Mass Flow Coefficient at Reference Conditions {kg/s}",
         "  0.667;                   !- Air Mass Flow Exponent {dimensionless}",
         "AirflowNetwork:MultiZone:ReferenceCrackConditions,",
         "  ReferenceCrackConditions,!- Name",
         "  20.0,                    !- Reference Temperature {C}",
         "  101320,                  !- Reference Barometric Pressure {Pa}",
         "  0.005;                   !- Reference Humidity Ratio {kgWater/kgDryAir}"});

    std::vector<Real64> valsForLeftWindow = {
        -1.3130779955194276,  -1.7404152241877022,  -1.9384350312723766,  -1.8112879523426120,   -1.4903484929957291,  -1.1589328567607411,
        -0.90795075070620501, -0.75899946242534944, -0.70518117657458634, -0.73794026769189536,  -0.70518117657458634, -0.75899946242534944,
        -0.90795075070620501, -1.1589328567607411,  -1.4903484929957291,  -1.8112879523426120,   -1.9384350312723766,  -1.7404152241877022,
        -1.3130779955194276,  -0.81787534059945755, -0.32789581427586245, -0.051561623181424314, 0.15922353989407620,  0.38420139813526627,
        0.61892682388527165,  0.85109949645405880,  1.0664888091014251,   1.2510276050004789,    1.0664888091014251,   0.85109949645405880,
        0.61892682388527165,  0.38420139813526627,  0.15922353989407620,  -0.051561623181424314, -0.32789581427586245, -0.81787534059945755,
        -1.3130779955194276};

    std::vector<Real64> valsForRightWindow = {
        -0.56146269488642231,  -0.81031499432463261,  -0.88587800418632712,  -0.70219756773378639, -0.39543597375365452,  -0.14821874325853215,
        -0.045339946833489957, -0.097330100392452740, -0.28213089764929783,  -0.57310708635195429, -0.28213089764929783,  -0.097330100392452740,
        -0.045339946833489957, -0.14821874325853215,  -0.39543597375365452,  -0.70219756773378639, -0.88587800418632712,  -0.81031499432463261,
        -0.56146269488642231,  -0.28653692388308377,  -0.041152159946210520, 0.37465991281286887,  0.81696925904461237,   1.1829453813575432,
        1.4391966568855996,    1.5699546250680769,    1.5837385005116038,    1.5105973452216215,   1.5837385005116038,    1.5699546250680769,
        1.4391966568855996,    1.1829453813575432,    0.81696925904461237,   0.37465991281286887,  -0.041152159946210520, -0.28653692388308377,
        -0.56146269488642231};

    ASSERT_TRUE(process_idf(idf_objects));
    state->init_state(*state);

    bool errors = false;

    Material::GetMaterialData(*state, errors); // read material data
    EXPECT_FALSE(errors);                      // expect no errors

    HeatBalanceManager::GetConstructData(*state, errors); // read construction data
    EXPECT_FALSE(errors);                                 // expect no errors

    HeatBalanceManager::GetZoneData(*state, errors); // read zone data
    EXPECT_FALSE(errors);                            // expect no errors

    // Magic to get surfaces read in correctly
    state->dataHeatBal->AnyCTF = true;
    state->dataSurfaceGeometry->CosBldgRotAppGonly = 1.0;
    state->dataSurfaceGeometry->SinBldgRotAppGonly = 0.0;

    SurfaceGeometry::GetSurfaceData(*state, errors); // setup zone geometry and get zone data
    EXPECT_FALSE(errors);                            // expect no errors

    EXPECT_EQ(0, state->dataCurveManager->curves.size());

    // #6912
    state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(1);
    state->dataZoneTempPredictorCorrector->zoneHeatBalance(1).MAT = 23.0;
    state->dataZoneTempPredictorCorrector->zoneHeatBalance(1).airHumRat = 0.001;
    state->dataEnvrn->OutDryBulbTemp = -17.29025;
    state->dataEnvrn->OutHumRat = 0.0008389;
    state->dataEnvrn->OutBaroPress = 99063.0;
    state->dataEnvrn->WindSpeed = 4.9;
    state->dataEnvrn->WindDir = 270.0;
    bool First = false;
    int iter = 1;
    bool resimu = false;

    state->dataHeatBal->Zone(1).OutDryBulbTemp = state->dataEnvrn->OutDryBulbTemp;
    state->afn->get_input();
    state->afn->AirflowNetworkGetInputFlag = false;
    state->afn->exchangeData.allocate(1);
    state->afn->manage_balance(First, iter, resimu);
    EXPECT_FALSE(resimu);
}

TEST_F(EnergyPlusFixture, AirflowNetwork_TestOtherSideCoefficients)
{

    int i = 2;

    state->afn->AirflowNetworkNumOfExtSurfaces = 2;
    state->afn->AirflowNetworkNumOfSurfaces = 2;

    state->afn->MultizoneSurfaceData.allocate(i);
    state->dataSurface->Surface.allocate(i);
    state->dataSurface->Surface(1).ExtBoundCond = -2;
    state->dataSurface->Surface(2).ExtBoundCond = -2;
    state->dataSurface->Surface(1).ExtWind = true;
    state->dataSurface->Surface(2).ExtWind = true;
    state->dataSurface->Surface(1).Tilt = 90.0;
    state->dataSurface->Surface(2).Tilt = 90.0;
    state->dataSurface->Surface(1).Azimuth = 0.0;
    state->dataSurface->Surface(2).Azimuth = 180.0;

    state->afn->MultizoneSurfaceData(1).SurfNum = 1;
    state->afn->MultizoneSurfaceData(2).SurfNum = 2;

    state->afn->calculate_Cps();
    EXPECT_EQ(1, state->afn->MultizoneSurfaceData(1).NodeNums[1]);
    EXPECT_EQ(2, state->afn->MultizoneSurfaceData(2).NodeNums[1]);
    EXPECT_EQ(1, state->afn->MultizoneExternalNodeData(1).curve);
    EXPECT_EQ(3, state->afn->MultizoneExternalNodeData(2).curve);

    state->afn->MultizoneSurfaceData.deallocate();
    state->afn->MultizoneExternalNodeData.deallocate();
    state->dataSurface->Surface.deallocate();
}

} // namespace EnergyPlus
